From 4243843951afed5aa947dbad023158d07e0eb666 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Sat, 3 Jan 2015 15:20:34 +0800 Subject: [PATCH] Refactoring. Move system plugins to seperate DLLs. --- .../CMD => Plugins/Wox.Plugin.CMD}/CMD.cs | 30 +--- .../Wox.Plugin.CMD}/CMDSetting.xaml | 2 +- .../Wox.Plugin.CMD}/CMDSetting.xaml.cs | 15 +- .../Wox.Plugin.CMD}/CMDStorage.cs | 7 +- .../Wox.Plugin.CMD}/Images/cmd.png | Bin .../Wox.Plugin.CMD/Properties/AssemblyInfo.cs | 36 ++++ Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj | 103 +++++++++++ Plugins/Wox.Plugin.CMD/packages.config | 5 + Plugins/Wox.Plugin.CMD/plugin.json | 12 ++ .../Wox.Plugin.Caculator}/Calculator.cs | 31 +--- .../Images/calculator.png | Bin .../Properties/AssemblyInfo.cs | 36 ++++ .../Wox.Plugin.Caculator.csproj | 87 +++++++++ Plugins/Wox.Plugin.Caculator/packages.config | 4 + Plugins/Wox.Plugin.Caculator/plugin.json | 12 ++ .../Wox.Plugin.Color/Color.cs | 31 +--- .../Wox.Plugin.Color/Images/color.png | Bin .../Properties/AssemblyInfo.cs | 36 ++++ .../Wox.Plugin.Color/Wox.Plugin.Color.csproj | 70 ++++++++ Plugins/Wox.Plugin.Color/plugin.json | 12 ++ .../Wox.Plugin.ControlPanel}/ControlPanel.cs | 34 +--- .../ControlPanelItem.cs | 2 +- .../ControlPanelList.cs | 8 +- .../Images/ControlPanel.png | Bin .../Properties/AssemblyInfo.cs | 36 ++++ .../Wox.Plugin.ControlPanel.csproj | 75 ++++++++ Plugins/Wox.Plugin.ControlPanel/plugin.json | 12 ++ .../Wox.Plugin.Folder}/FolderPlugin.cs | 35 +--- .../FolderPluginSettings.xaml | 2 +- .../FolderPluginSettings.xaml.cs | 11 +- .../Wox.Plugin.Folder}/Images/folder.png | Bin .../Properties/AssemblyInfo.cs | 36 ++++ .../Wox.Plugin.Folder.csproj | 99 ++++++++++ Plugins/Wox.Plugin.Folder/packages.config | 4 + Plugins/Wox.Plugin.Folder/plugin.json | 12 ++ .../Images/work.png | Bin .../PluginIndicator.cs | 41 ++--- .../Properties/AssemblyInfo.cs | 36 ++++ .../Wox.Plugin.PluginIndicator.csproj | 72 ++++++++ .../Wox.Plugin.PluginIndicator/plugin.json | 12 ++ .../Wox.Plugin.PluginManagement.csproj | 4 +- .../Wox.Plugin.Program}/FileChangeWatcher.cs | 7 +- .../Wox.Plugin.Program}/IProgramSource.cs | 2 +- .../Wox.Plugin.Program}/Images/program.png | Bin Plugins/Wox.Plugin.Program/Languages/en.xaml | 6 + .../Wox.Plugin.Program}/Program.cs | 2 +- .../ProgramCacheStorage.cs | 3 +- .../Wox.Plugin.Program}/ProgramSetting.xaml | 4 +- .../ProgramSetting.xaml.cs | 2 +- .../ProgramSources/AppPathsProgramSource.cs | 2 +- .../CommonStartMenuProgramSource.cs | 2 +- .../FileSystemFolderSourceShallow.cs | 0 .../ProgramSources/FileSystemProgramSource.cs | 4 +- .../UserStartMenuProgramSource.cs | 2 +- .../Wox.Plugin.Program}/ProgramSuffixes.xaml | 2 +- .../ProgramSuffixes.xaml.cs | 16 +- .../Wox.Plugin.Program}/Programs.cs | 34 +--- .../Properties/AssemblyInfo.cs | 36 ++++ .../StringEmptyConverter.cs | 2 +- .../Wox.Plugin.Program.csproj | 124 +++++++++++++ Plugins/Wox.Plugin.Program/packages.config | 5 + Plugins/Wox.Plugin.Program/plugin.json | 12 ++ Plugins/Wox.Plugin.Sys/Images/app.png | Bin 0 -> 11524 bytes .../Wox.Plugin.Sys}/Images/close.png | Bin .../Wox.Plugin.Sys}/Images/exit.png | Bin .../Wox.Plugin.Sys}/Images/lock.png | Bin .../Wox.Plugin.Sys}/Images/logoff.png | Bin .../Wox.Plugin.Sys}/Images/restart.png | Bin .../Wox.Plugin.Sys/Properties/AssemblyInfo.cs | 36 ++++ .../Sys => Plugins/Wox.Plugin.Sys}/Sys.cs | 37 +--- .../Wox.Plugin.Sys}/SysSettings.xaml | 2 +- Plugins/Wox.Plugin.Sys/SysSettings.xaml.cs | 17 ++ Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj | 123 +++++++++++++ Plugins/Wox.Plugin.Sys/packages.config | 4 + Plugins/Wox.Plugin.Sys/plugin.json | 12 ++ .../Wox.Plugin.Url}/Images/url.png | Bin .../Wox.Plugin.Url/Properties/AssemblyInfo.cs | 36 ++++ .../Wox.Plugin.Url}/UrlPlugin.cs | 21 +-- Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj | 71 ++++++++ Plugins/Wox.Plugin.Url/plugin.json | 12 ++ .../Images/web_search.png | Bin .../Images/websearch/google.png | Bin .../Images/websearch/pictures.png | Bin .../Images/websearch/wiki.png | Bin .../Properties/AssemblyInfo.cs | 36 ++++ .../SuggestionSources/Baidu.cs | 8 +- .../SuggestionSources/Google.cs | 8 +- .../SuggestionSources/ISuggestionSource.cs | 8 +- .../SuggestionSourceFactory.cs | 7 +- .../Wox.Plugin.WebSearch}/WebSearchPlugin.cs | 36 +--- .../WebSearchSetting.xaml | 2 +- .../WebSearchSetting.xaml.cs | 28 +-- .../WebSearchesSetting.xaml | 2 +- .../WebSearchesSetting.xaml.cs | 6 +- .../Wox.Plugin.WebSearch.csproj | 125 +++++++++++++ Plugins/Wox.Plugin.WebSearch/packages.config | 5 + Plugins/Wox.Plugin.WebSearch/plugin.json | 12 ++ Wox.Core/Exception/WoxI18nException.cs | 14 ++ Wox.Core/Plugin/CSharpPluginLoader.cs | 14 +- Wox.Core/Plugin/PluginConfig.cs | 29 +-- .../SystemPluginQueryDispatcher.cs | 4 +- Wox.Core/Plugin/README.md | 5 + Wox.Core/Theme/ITheme.cs | 13 ++ Wox.Core/Theme/Theme.cs | 129 +++++++++++++ Wox.Core/Theme/ThemeManager.cs | 130 +------------- Wox.Core/UI/IUIResource.cs | 16 ++ Wox.Core/Wox.Core.csproj | 14 +- Wox.Core/i18n/AvailableLanguages.cs | 25 +++ Wox.Core/i18n/IInternationalization.cs | 18 ++ Wox.Core/i18n/Internationalization.cs | 130 ++++++++++++++ Wox.Core/i18n/InternationalizationManager.cs | 113 +----------- Wox.Core/i18n/Language.cs | 23 +++ Wox.Infrastructure/ISingleton.cs | 12 -- Wox.Infrastructure/Wox.Infrastructure.csproj | 1 - Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs | 52 ------ Wox.Plugin.SystemPlugins/ISystemPlugin.cs | 14 -- .../Properties/AssemblyInfo.cs | 36 ---- .../Sys/SysSettings.xaml.cs | 28 --- .../Wox.Plugin.SystemPlugins.csproj | 169 ------------------ Wox.Plugin.SystemPlugins/packages.config | 8 - Wox.Test/UrlPluginTest.cs | 2 +- Wox.Test/Wox.Test.csproj | 8 +- Wox.sln | 76 +++++++- Wox/ActionKeyword.xaml.cs | 8 +- Wox/App.xaml | 2 +- Wox/CustomQueryHotkeySetting.xaml.cs | 12 +- Wox/HotkeyControl.xaml.cs | 4 +- Wox/Languages/{English.xaml => en.xaml} | 0 Wox/Languages/{中文.xaml => zh-cn.xaml} | 0 Wox/Languages/zh-tw.xaml | 85 +++++++++ Wox/MainWindow.xaml.cs | 10 +- Wox/SettingWindow.xaml | 19 -- Wox/SettingWindow.xaml.cs | 86 +++------ Wox/Wox.csproj | 77 ++------ 134 files changed, 2209 insertions(+), 1158 deletions(-) rename {Wox.Plugin.SystemPlugins/CMD => Plugins/Wox.Plugin.CMD}/CMD.cs (89%) rename {Wox.Plugin.SystemPlugins/CMD => Plugins/Wox.Plugin.CMD}/CMDSetting.xaml (94%) rename {Wox.Plugin.SystemPlugins/CMD => Plugins/Wox.Plugin.CMD}/CMDSetting.xaml.cs (77%) rename {Wox.Plugin.SystemPlugins/CMD => Plugins/Wox.Plugin.CMD}/CMDStorage.cs (83%) rename {Wox => Plugins/Wox.Plugin.CMD}/Images/cmd.png (100%) create mode 100644 Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs create mode 100644 Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj create mode 100644 Plugins/Wox.Plugin.CMD/packages.config create mode 100644 Plugins/Wox.Plugin.CMD/plugin.json rename {Wox.Plugin.SystemPlugins => Plugins/Wox.Plugin.Caculator}/Calculator.cs (81%) rename {Wox => Plugins/Wox.Plugin.Caculator}/Images/calculator.png (100%) create mode 100644 Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs create mode 100644 Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj create mode 100644 Plugins/Wox.Plugin.Caculator/packages.config create mode 100644 Plugins/Wox.Plugin.Caculator/plugin.json rename Wox.Plugin.SystemPlugins/ColorsPlugin.cs => Plugins/Wox.Plugin.Color/Color.cs (80%) rename Wox/Images/color2.png => Plugins/Wox.Plugin.Color/Images/color.png (100%) create mode 100644 Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs create mode 100644 Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj create mode 100644 Plugins/Wox.Plugin.Color/plugin.json rename {Wox.Plugin.SystemPlugins/ControlPanel => Plugins/Wox.Plugin.ControlPanel}/ControlPanel.cs (75%) rename {Wox.Plugin.SystemPlugins/ControlPanel => Plugins/Wox.Plugin.ControlPanel}/ControlPanelItem.cs (94%) rename {Wox.Plugin.SystemPlugins/ControlPanel => Plugins/Wox.Plugin.ControlPanel}/ControlPanelList.cs (99%) rename {Wox => Plugins/Wox.Plugin.ControlPanel}/Images/ControlPanel.png (100%) create mode 100644 Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs create mode 100644 Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj create mode 100644 Plugins/Wox.Plugin.ControlPanel/plugin.json rename {Wox.Plugin.SystemPlugins/Folder => Plugins/Wox.Plugin.Folder}/FolderPlugin.cs (88%) rename {Wox.Plugin.SystemPlugins/Folder => Plugins/Wox.Plugin.Folder}/FolderPluginSettings.xaml (94%) rename {Wox.Plugin.SystemPlugins/Folder => Plugins/Wox.Plugin.Folder}/FolderPluginSettings.xaml.cs (87%) rename {Wox => Plugins/Wox.Plugin.Folder}/Images/folder.png (100%) create mode 100644 Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs create mode 100644 Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj create mode 100644 Plugins/Wox.Plugin.Folder/packages.config create mode 100644 Plugins/Wox.Plugin.Folder/plugin.json rename {Wox => Plugins/Wox.Plugin.PluginIndicator}/Images/work.png (100%) rename Wox.Plugin.SystemPlugins/UserPluginIndicator.cs => Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs (69%) create mode 100644 Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs create mode 100644 Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj create mode 100644 Plugins/Wox.Plugin.PluginIndicator/plugin.json rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/FileChangeWatcher.cs (92%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/IProgramSource.cs (96%) rename {Wox => Plugins/Wox.Plugin.Program}/Images/program.png (100%) create mode 100644 Plugins/Wox.Plugin.Program/Languages/en.xaml rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/Program.cs (96%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramCacheStorage.cs (84%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSetting.xaml (95%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSetting.xaml.cs (98%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSources/AppPathsProgramSource.cs (96%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSources/CommonStartMenuProgramSource.cs (95%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSources/FileSystemFolderSourceShallow.cs (100%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSources/FileSystemProgramSource.cs (94%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSources/UserStartMenuProgramSource.cs (91%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSuffixes.xaml (93%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/ProgramSuffixes.xaml.cs (65%) rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/Programs.cs (88%) create mode 100644 Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs rename {Wox.Plugin.SystemPlugins/Program => Plugins/Wox.Plugin.Program}/StringEmptyConverter.cs (94%) create mode 100644 Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj create mode 100644 Plugins/Wox.Plugin.Program/packages.config create mode 100644 Plugins/Wox.Plugin.Program/plugin.json create mode 100644 Plugins/Wox.Plugin.Sys/Images/app.png rename {Wox => Plugins/Wox.Plugin.Sys}/Images/close.png (100%) rename {Wox => Plugins/Wox.Plugin.Sys}/Images/exit.png (100%) rename {Wox => Plugins/Wox.Plugin.Sys}/Images/lock.png (100%) rename {Wox => Plugins/Wox.Plugin.Sys}/Images/logoff.png (100%) rename {Wox => Plugins/Wox.Plugin.Sys}/Images/restart.png (100%) create mode 100644 Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs rename {Wox.Plugin.SystemPlugins/Sys => Plugins/Wox.Plugin.Sys}/Sys.cs (80%) rename {Wox.Plugin.SystemPlugins/Sys => Plugins/Wox.Plugin.Sys}/SysSettings.xaml (94%) create mode 100644 Plugins/Wox.Plugin.Sys/SysSettings.xaml.cs create mode 100644 Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj create mode 100644 Plugins/Wox.Plugin.Sys/packages.config create mode 100644 Plugins/Wox.Plugin.Sys/plugin.json rename {Wox => Plugins/Wox.Plugin.Url}/Images/url.png (100%) create mode 100644 Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs rename {Wox.Plugin.SystemPlugins => Plugins/Wox.Plugin.Url}/UrlPlugin.cs (83%) create mode 100644 Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj create mode 100644 Plugins/Wox.Plugin.Url/plugin.json rename {Wox => Plugins/Wox.Plugin.WebSearch}/Images/web_search.png (100%) rename {Wox => Plugins/Wox.Plugin.WebSearch}/Images/websearch/google.png (100%) rename {Wox => Plugins/Wox.Plugin.WebSearch}/Images/websearch/pictures.png (100%) rename {Wox => Plugins/Wox.Plugin.WebSearch}/Images/websearch/wiki.png (100%) create mode 100644 Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs rename {Wox.Plugin.SystemPlugins => Plugins/Wox.Plugin.WebSearch}/SuggestionSources/Baidu.cs (86%) rename {Wox.Plugin.SystemPlugins => Plugins/Wox.Plugin.WebSearch}/SuggestionSources/Google.cs (84%) rename {Wox.Plugin.SystemPlugins => Plugins/Wox.Plugin.WebSearch}/SuggestionSources/ISuggestionSource.cs (56%) rename {Wox.Plugin.SystemPlugins => Plugins/Wox.Plugin.WebSearch}/SuggestionSources/SuggestionSourceFactory.cs (74%) rename {Wox.Plugin.SystemPlugins/WebSearch => Plugins/Wox.Plugin.WebSearch}/WebSearchPlugin.cs (78%) rename {Wox.Plugin.SystemPlugins/WebSearch => Plugins/Wox.Plugin.WebSearch}/WebSearchSetting.xaml (97%) rename {Wox.Plugin.SystemPlugins/WebSearch => Plugins/Wox.Plugin.WebSearch}/WebSearchSetting.xaml.cs (83%) rename {Wox.Plugin.SystemPlugins/WebSearch => Plugins/Wox.Plugin.WebSearch}/WebSearchesSetting.xaml (97%) rename {Wox.Plugin.SystemPlugins/WebSearch => Plugins/Wox.Plugin.WebSearch}/WebSearchesSetting.xaml.cs (91%) create mode 100644 Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj create mode 100644 Plugins/Wox.Plugin.WebSearch/packages.config create mode 100644 Plugins/Wox.Plugin.WebSearch/plugin.json create mode 100644 Wox.Core/Exception/WoxI18nException.cs create mode 100644 Wox.Core/Plugin/README.md create mode 100644 Wox.Core/Theme/ITheme.cs create mode 100644 Wox.Core/Theme/Theme.cs create mode 100644 Wox.Core/UI/IUIResource.cs create mode 100644 Wox.Core/i18n/AvailableLanguages.cs create mode 100644 Wox.Core/i18n/IInternationalization.cs create mode 100644 Wox.Core/i18n/Internationalization.cs create mode 100644 Wox.Core/i18n/Language.cs delete mode 100644 Wox.Infrastructure/ISingleton.cs delete mode 100644 Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs delete mode 100644 Wox.Plugin.SystemPlugins/ISystemPlugin.cs delete mode 100644 Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs delete mode 100644 Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml.cs delete mode 100644 Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj delete mode 100644 Wox.Plugin.SystemPlugins/packages.config rename Wox/Languages/{English.xaml => en.xaml} (100%) rename Wox/Languages/{中文.xaml => zh-cn.xaml} (100%) create mode 100644 Wox/Languages/zh-tw.xaml diff --git a/Wox.Plugin.SystemPlugins/CMD/CMD.cs b/Plugins/Wox.Plugin.CMD/CMD.cs similarity index 89% rename from Wox.Plugin.SystemPlugins/CMD/CMD.cs rename to Plugins/Wox.Plugin.CMD/CMD.cs index 7855c7d6fc..938815e1da 100644 --- a/Wox.Plugin.SystemPlugins/CMD/CMD.cs +++ b/Plugins/Wox.Plugin.CMD/CMD.cs @@ -2,17 +2,15 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.Serialization.Formatters.Binary; -using System.Windows.Forms; using Control = System.Windows.Controls.Control; -namespace Wox.Plugin.SystemPlugins.CMD +namespace Wox.Plugin.CMD { - public class CMD : BaseSystemPlugin, ISettingProvider + public class CMD : IPlugin, ISettingProvider { private PluginInitContext context; - protected override List QueryInternal(Query query) + public List Query(Query query) { List results = new List(); List pushedResults = new List(); @@ -165,31 +163,11 @@ namespace Wox.Plugin.SystemPlugins.CMD CMDStorage.Instance.AddCmdHistory(cmd); } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; } - public override string ID - { - get { return "D409510CD0D2481F853690A07E6DC426"; } - } - - public override string Name - { - get { return "Shell"; } - } - - public override string IcoPath - { - get { return @"Images\cmd.png"; } - } - - public override string Description - { - get { return "Provide executing commands from Wox. Commands should start with >"; } - } - public Control CreateSettingPanel() { return new CMDSetting(); diff --git a/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml b/Plugins/Wox.Plugin.CMD/CMDSetting.xaml similarity index 94% rename from Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml rename to Plugins/Wox.Plugin.CMD/CMDSetting.xaml index e7b5d5e2c0..8952c9d1cb 100644 --- a/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml +++ b/Plugins/Wox.Plugin.CMD/CMDSetting.xaml @@ -1,4 +1,4 @@ - { diff --git a/Wox/Images/cmd.png b/Plugins/Wox.Plugin.CMD/Images/cmd.png similarity index 100% rename from Wox/Images/cmd.png rename to Plugins/Wox.Plugin.CMD/Images/cmd.png diff --git a/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..fac890b6dd --- /dev/null +++ b/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.CMD")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.CMD")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("9283a32d-5d3c-4231-96e0-2150ed4716b9")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj new file mode 100644 index 0000000000..64bb3df4c0 --- /dev/null +++ b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj @@ -0,0 +1,103 @@ + + + + + Debug + AnyCPU + {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} + Library + Properties + Wox.Plugin.CMD + Wox.Plugin.CMD + v3.5 + 512 + ..\..\ + true + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.CMD\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll + + + False + ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll + + + + + + + + + + + + + + + CMDSetting.xaml + + + + + + + MSBuild:Compile + Designer + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.CMD/packages.config b/Plugins/Wox.Plugin.CMD/packages.config new file mode 100644 index 0000000000..6c533b9f5c --- /dev/null +++ b/Plugins/Wox.Plugin.CMD/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.CMD/plugin.json b/Plugins/Wox.Plugin.CMD/plugin.json new file mode 100644 index 0000000000..949a499983 --- /dev/null +++ b/Plugins/Wox.Plugin.CMD/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"D409510CD0D2481F853690A07E6DC426", + "ActionKeyword":"*", + "Name":"Shell", + "Description":"Provide executing commands from Wox. Commands should start with >", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.CMD.dll", + "IcoPath":"Images\\cmd.png" +} diff --git a/Wox.Plugin.SystemPlugins/Calculator.cs b/Plugins/Wox.Plugin.Caculator/Calculator.cs similarity index 81% rename from Wox.Plugin.SystemPlugins/Calculator.cs rename to Plugins/Wox.Plugin.Caculator/Calculator.cs index 67602cc47b..f760746712 100644 --- a/Wox.Plugin.SystemPlugins/Calculator.cs +++ b/Plugins/Wox.Plugin.Caculator/Calculator.cs @@ -5,12 +5,12 @@ using System.Linq; using System.Reflection; using System.Text; using System.Text.RegularExpressions; -using System.Windows.Forms; +using System.Windows; using YAMP; namespace Wox.Plugin.SystemPlugins { - public class Calculator : BaseSystemPlugin + public class Calculator : IPlugin { private static Regex regValidExpressChar = new Regex( @"^(" + @@ -31,7 +31,7 @@ namespace Wox.Plugin.SystemPlugins Parser.UseScripting = false; } - protected override List QueryInternal(Query query) + public List Query(Query query) { if (query.RawQuery.Length <= 2 // don't affect when user only input "e" or "i" keyword || !regValidExpressChar.IsMatch(query.RawQuery) @@ -88,32 +88,9 @@ namespace Wox.Plugin.SystemPlugins return leftBracketCount == 0; } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; } - - public override string ID - { - get { return "CEA0FDFC6D3B4085823D60DC76F28855"; } - } - - public override string Name - { - get { return "Calculator"; } - } - - public override string IcoPath - { - get { return @"Images\calculator.png"; } - } - - public override string Description - { - get - { - return "Provide mathematical calculations.(Try 5*3-2 in Wox)"; - } - } } } diff --git a/Wox/Images/calculator.png b/Plugins/Wox.Plugin.Caculator/Images/calculator.png similarity index 100% rename from Wox/Images/calculator.png rename to Plugins/Wox.Plugin.Caculator/Images/calculator.png diff --git a/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..a4ddfc5313 --- /dev/null +++ b/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.Caculator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.Caculator")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("ba698b90-59ed-4c2e-bce1-497eb2f9e76f")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj b/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj new file mode 100644 index 0000000000..bc5c57319f --- /dev/null +++ b/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj @@ -0,0 +1,87 @@ + + + + + Debug + AnyCPU + {59BD9891-3837-438A-958D-ADC7F91F6F7E} + Library + Properties + Wox.Plugin.Caculator + Wox.Plugin.Caculator + v3.5 + 512 + ..\..\ + true + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.Caculator\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + ..\..\packages\YAMP.1.4.0\lib\net35\YAMP.dll + + + + + + + + + + PreserveNewest + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + PreserveNewest + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Caculator/packages.config b/Plugins/Wox.Plugin.Caculator/packages.config new file mode 100644 index 0000000000..4e151aa36f --- /dev/null +++ b/Plugins/Wox.Plugin.Caculator/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Caculator/plugin.json b/Plugins/Wox.Plugin.Caculator/plugin.json new file mode 100644 index 0000000000..29ed5d15cc --- /dev/null +++ b/Plugins/Wox.Plugin.Caculator/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"CEA0FDFC6D3B4085823D60DC76F28855", + "ActionKeyword":"*", + "Name":"Calculator", + "Description":"Provide mathematical calculations.(Try 5*3-2 in Wox)", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.Caculator.dll", + "IcoPath":"Images\\calculator.png" +} \ No newline at end of file diff --git a/Wox.Plugin.SystemPlugins/ColorsPlugin.cs b/Plugins/Wox.Plugin.Color/Color.cs similarity index 80% rename from Wox.Plugin.SystemPlugins/ColorsPlugin.cs rename to Plugins/Wox.Plugin.Color/Color.cs index d80f685db0..ab5a70cc19 100644 --- a/Wox.Plugin.SystemPlugins/ColorsPlugin.cs +++ b/Plugins/Wox.Plugin.Color/Color.cs @@ -6,9 +6,9 @@ using System.IO; using System.Linq; using System.Windows; -namespace Wox.Plugin.SystemPlugins +namespace Wox.Plugin.Color { - public sealed class ColorsPlugin : BaseSystemPlugin + public sealed class ColorsPlugin : IPlugin { private string DIR_PATH = Path.Combine(Path.GetTempPath(), @"Plugins\Colors\"); private const int IMG_SIZE = 32; @@ -27,7 +27,7 @@ namespace Wox.Plugin.SystemPlugins } } - protected override List QueryInternal(Query query) + public List Query(Query query) { var raw = query.RawQuery; if (!IsAvailable(raw)) return new List(0); @@ -101,30 +101,7 @@ namespace Wox.Plugin.SystemPlugins return string.Format("{0}{1}.png", ColorsDirectory.FullName, name.Substring(1)); } - public override string ID - { - get { return "9B36CE6181FC47FBB597AA2C29CD9B0A"; } - } - - public override string Name - { - get { return "Colors"; } - } - - public override string Description - { - get - { - return "Provide hex color preview.(Try #000 in Wox)"; - } - } - - public override string IcoPath - { - get { return "Images/color2.png"; } - } - - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { } } diff --git a/Wox/Images/color2.png b/Plugins/Wox.Plugin.Color/Images/color.png similarity index 100% rename from Wox/Images/color2.png rename to Plugins/Wox.Plugin.Color/Images/color.png diff --git a/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..7578ccd763 --- /dev/null +++ b/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.Color")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.Color")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("46b03f84-5bf7-4ed4-a69b-f0274c8b3776")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj b/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj new file mode 100644 index 0000000000..fd4e5f66a3 --- /dev/null +++ b/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {F35190AA-4758-4D9E-A193-E3BDF6AD3567} + Library + Properties + Wox.Plugin.Color + Wox.Plugin.Color + v3.5 + 512 + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.Color\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Color/plugin.json b/Plugins/Wox.Plugin.Color/plugin.json new file mode 100644 index 0000000000..16eddbb6d7 --- /dev/null +++ b/Plugins/Wox.Plugin.Color/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"9B36CE6181FC47FBB597AA2C29CD9B0A", + "ActionKeyword":"*", + "Name":"Colors", + "Description":"Provide hex color preview.(Try #000 in Wox)", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.Color.dll", + "IcoPath":"Images\\color.png" +} diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs b/Plugins/Wox.Plugin.ControlPanel/ControlPanel.cs similarity index 75% rename from Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs rename to Plugins/Wox.Plugin.ControlPanel/ControlPanel.cs index 48c11882d7..e3f5918a4a 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs +++ b/Plugins/Wox.Plugin.ControlPanel/ControlPanel.cs @@ -5,42 +5,20 @@ using System.IO; using System.Linq; using Wox.Infrastructure; -namespace Wox.Plugin.SystemPlugins.ControlPanel +namespace Wox.Plugin.ControlPanel { - public class ControlPanel : BaseSystemPlugin + public class ControlPanel : IPlugin { - #region Properties - private PluginInitContext context; - - public override string Description - { - get - { - return "Search within the Control Panel."; - } - } - - public override string ID - { - get { return "209621585B9B4D81813913C507C058C6"; } - } - - public override string Name { get { return "Control Panel"; } } - - public override string IcoPath { get { return @"Images\ControlPanel.png"; } } - private List controlPanelItems = new List(); private string iconFolder; private string fileType; - #endregion Properties - - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; controlPanelItems = ControlPanelList.Create(48); - iconFolder = @"Images\ControlPanelIcons\"; + iconFolder = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, @"Images\ControlPanelIcons\"); fileType = ".bmp"; if (!Directory.Exists(iconFolder)) @@ -58,7 +36,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel } } - protected override List QueryInternal(Query query) + public List Query(Query query) { if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List(); string myQuery = query.RawQuery.Trim(); @@ -75,7 +53,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel Title = item.LocalizedString, SubTitle = item.InfoTip, Score = item.Score, - IcoPath = "Images\\ControlPanelIcons\\" + item.GUID + fileType, + IcoPath = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, @"Images\\ControlPanelIcons\\" + item.GUID + fileType), Action = e => { try diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs b/Plugins/Wox.Plugin.ControlPanel/ControlPanelItem.cs similarity index 94% rename from Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs rename to Plugins/Wox.Plugin.ControlPanel/ControlPanelItem.cs index 5781fa2910..a63c9a19c6 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs +++ b/Plugins/Wox.Plugin.ControlPanel/ControlPanelItem.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Drawing; -namespace Wox.Plugin.SystemPlugins.ControlPanel +namespace Wox.Plugin.ControlPanel { //from:https://raw.githubusercontent.com/CoenraadS/Windows-Control-Panel-Items public class ControlPanelItem diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs b/Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs similarity index 99% rename from Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs rename to Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs index 9f3fbcfcbb..724688e4e1 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs +++ b/Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; -using System.Text; -using Microsoft.Win32; -using System.Runtime.InteropServices; using System.Diagnostics; using System.Drawing; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32; -namespace Wox.Plugin.SystemPlugins.ControlPanel +namespace Wox.Plugin.ControlPanel { //from:https://raw.githubusercontent.com/CoenraadS/Windows-Control-Panel-Items public static class ControlPanelList diff --git a/Wox/Images/ControlPanel.png b/Plugins/Wox.Plugin.ControlPanel/Images/ControlPanel.png similarity index 100% rename from Wox/Images/ControlPanel.png rename to Plugins/Wox.Plugin.ControlPanel/Images/ControlPanel.png diff --git a/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..dbbad24f59 --- /dev/null +++ b/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.ControlPanel")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.ControlPanel")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("59141b10-8941-4e90-a0a6-bc9385a04cc6")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj b/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj new file mode 100644 index 0000000000..c0d0e01b48 --- /dev/null +++ b/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} + Library + Properties + Wox.Plugin.ControlPanel + Wox.Plugin.ControlPanel + v3.5 + 512 + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.ControlPanel\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + PreserveNewest + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.ControlPanel/plugin.json b/Plugins/Wox.Plugin.ControlPanel/plugin.json new file mode 100644 index 0000000000..d0724a6ec2 --- /dev/null +++ b/Plugins/Wox.Plugin.ControlPanel/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"209621585B9B4D81813913C507C058C6", + "ActionKeyword":"*", + "Name":"Control Panel", + "Description":"Search within the Control Panel.", + "Author":"CoenraadS", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.ControlPanel.dll", + "IcoPath":"Images\\ControlPanel.png" +} diff --git a/Wox.Plugin.SystemPlugins/Folder/FolderPlugin.cs b/Plugins/Wox.Plugin.Folder/FolderPlugin.cs similarity index 88% rename from Wox.Plugin.SystemPlugins/Folder/FolderPlugin.cs rename to Plugins/Wox.Plugin.Folder/FolderPlugin.cs index 00f94f06a6..91a4db8708 100644 --- a/Wox.Plugin.SystemPlugins/Folder/FolderPlugin.cs +++ b/Plugins/Wox.Plugin.Folder/FolderPlugin.cs @@ -3,47 +3,23 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Windows.Forms; +using System.Windows; using Wox.Infrastructure.Storage.UserSettings; using Control = System.Windows.Controls.Control; -namespace Wox.Plugin.SystemPlugins.Folder +namespace Wox.Plugin.Folder { - public class FolderPlugin : BaseSystemPlugin, ISettingProvider + public class FolderPlugin : IPlugin, ISettingProvider { - #region Properties - private static List driverNames; private PluginInitContext context; - public override string Description - { - get { return "Provide opening folder from wox directorily. You can add your favorite folders."; } - } - - public override string ID - { - get { return "B4D3B69656E14D44865C8D818EAE47C4"; } - } - - public override string Name - { - get { return "Folder"; } - } - - public override string IcoPath - { - get { return @"Images\folder.png"; } - } - - #endregion Properties - public Control CreateSettingPanel() { return new FileSystemSettings(); } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; this.context.API.BackKeyDownEvent += ApiBackKeyDownEvent; @@ -75,8 +51,9 @@ namespace Wox.Plugin.SystemPlugins.Folder } } - protected override List QueryInternal(Query query) + public List Query(Query query) { + if(string.IsNullOrEmpty(query.RawQuery)) return new List(); string input = query.RawQuery.ToLower(); List userFolderLinks = UserSettingStorage.Instance.FolderLinks.Where( diff --git a/Wox.Plugin.SystemPlugins/Folder/FolderPluginSettings.xaml b/Plugins/Wox.Plugin.Folder/FolderPluginSettings.xaml similarity index 94% rename from Wox.Plugin.SystemPlugins/Folder/FolderPluginSettings.xaml rename to Plugins/Wox.Plugin.Folder/FolderPluginSettings.xaml index 59e57e906b..8a0c916d6a 100644 --- a/Wox.Plugin.SystemPlugins/Folder/FolderPluginSettings.xaml +++ b/Plugins/Wox.Plugin.Folder/FolderPluginSettings.xaml @@ -1,4 +1,4 @@ - /// Interaction logic for FileSystemSettings.xaml @@ -33,10 +35,9 @@ namespace Wox.Plugin.SystemPlugins.Folder { var selectedFolder = lbxFolders.SelectedItem as FolderLink; if (selectedFolder != null) { - - var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + var folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.SelectedPath = selectedFolder.Path; - if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { var link = UserSettingStorage.Instance.FolderLinks.First(x => x.Path == selectedFolder.Path); link.Path = folderBrowserDialog.SelectedPath; diff --git a/Wox/Images/folder.png b/Plugins/Wox.Plugin.Folder/Images/folder.png similarity index 100% rename from Wox/Images/folder.png rename to Plugins/Wox.Plugin.Folder/Images/folder.png diff --git a/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..5cf2f0b6e8 --- /dev/null +++ b/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.Folder")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.Folder")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("e047418e-f7b0-4a3a-b855-0bef7178179f")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj new file mode 100644 index 0000000000..ad948613c7 --- /dev/null +++ b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj @@ -0,0 +1,99 @@ + + + + + Debug + AnyCPU + {787B8AA6-CA93-4C84-96FE-DF31110AD1C4} + Library + Properties + Wox.Plugin.Folder + Wox.Plugin.Folder + v3.5 + 512 + ..\..\ + true + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.Folder\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll + + + + + + + + + + + + + + + + FolderPluginSettings.xaml + + + + + + + PreserveNewest + + + + + MSBuild:Compile + Designer + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + PreserveNewest + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Folder/packages.config b/Plugins/Wox.Plugin.Folder/packages.config new file mode 100644 index 0000000000..7eb67aa24b --- /dev/null +++ b/Plugins/Wox.Plugin.Folder/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Folder/plugin.json b/Plugins/Wox.Plugin.Folder/plugin.json new file mode 100644 index 0000000000..d9129e4d34 --- /dev/null +++ b/Plugins/Wox.Plugin.Folder/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"B4D3B69656E14D44865C8D818EAE47C4", + "ActionKeyword":"*", + "Name":"Folder", + "Description":"Provide opening folder from wox directorily. You can add your favorite folders.", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.Folder.dll", + "IcoPath":"Images\\folder.png" +} diff --git a/Wox/Images/work.png b/Plugins/Wox.Plugin.PluginIndicator/Images/work.png similarity index 100% rename from Wox/Images/work.png rename to Plugins/Wox.Plugin.PluginIndicator/Images/work.png diff --git a/Wox.Plugin.SystemPlugins/UserPluginIndicator.cs b/Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs similarity index 69% rename from Wox.Plugin.SystemPlugins/UserPluginIndicator.cs rename to Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs index cc1d492a3b..4198993be9 100644 --- a/Wox.Plugin.SystemPlugins/UserPluginIndicator.cs +++ b/Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs @@ -1,23 +1,23 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using Wox.Infrastructure; -using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.SystemPlugins +namespace Wox.Plugin.PluginIndicator { - public class UserPluginIndicator : BaseSystemPlugin + public class PluginIndicator : IPlugin { private List allPlugins = new List(); private PluginInitContext context; - protected override List QueryInternal(Query query) + public List Query(Query query) { List results = new List(); - if(allPlugins.Count == 0) allPlugins = context.API.GetAllPlugins(); + if (string.IsNullOrEmpty(query.RawQuery)) return results; + if (allPlugins.Count == 0) + { + allPlugins = context.API.GetAllPlugins().Where(o => o.Metadata.ActionKeyword != "*").ToList(); + } foreach (PluginMetadata metadata in allPlugins.Select(o => o.Metadata)) { @@ -62,30 +62,9 @@ namespace Wox.Plugin.SystemPlugins return results; } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; } - - - public override string ID - { - get { return "6A122269676E40EB86EB543B945932B9"; } - } - - public override string Name - { - get { return "Third-party Plugin Indicator"; } - } - - public override string IcoPath - { - get { return @"Images\work.png"; } - } - - public override string Description - { - get { return "Provide Third-party plugin actionword suggestion."; } - } } } diff --git a/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..81a83a2dcd --- /dev/null +++ b/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.PluginIndicator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.PluginIndicator")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("27f6d9fc-340b-47be-90ea-2a86bfca7bad")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj b/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj new file mode 100644 index 0000000000..1c7a356bf6 --- /dev/null +++ b/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj @@ -0,0 +1,72 @@ + + + + + Debug + AnyCPU + {FDED22C8-B637-42E8-824A-63B5B6E05A3A} + Library + Properties + Wox.Plugin.PluginIndicator + Wox.Plugin.PluginIndicator + v3.5 + 512 + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.PluginIndicator\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + PreserveNewest + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + PreserveNewest + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.PluginIndicator/plugin.json b/Plugins/Wox.Plugin.PluginIndicator/plugin.json new file mode 100644 index 0000000000..333f48eaeb --- /dev/null +++ b/Plugins/Wox.Plugin.PluginIndicator/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"6A122269676E40EB86EB543B945932B9", + "ActionKeyword":"*", + "Name":"Plugin Indicator", + "Description":"Provide plugin actionword suggestion.", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.PluginIndicator.dll", + "IcoPath":"Images\\work.png" +} diff --git a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj index d080cc10f8..d8b2be74aa 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj +++ b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj @@ -62,9 +62,9 @@ - + PreserveNewest - + diff --git a/Wox.Plugin.SystemPlugins/Program/FileChangeWatcher.cs b/Plugins/Wox.Plugin.Program/FileChangeWatcher.cs similarity index 92% rename from Wox.Plugin.SystemPlugins/Program/FileChangeWatcher.cs rename to Plugins/Wox.Plugin.Program/FileChangeWatcher.cs index 4c007cac95..f6845e0908 100644 --- a/Wox.Plugin.SystemPlugins/Program/FileChangeWatcher.cs +++ b/Plugins/Wox.Plugin.Program/FileChangeWatcher.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Text; using System.Threading; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { internal class FileChangeWatcher { diff --git a/Wox.Plugin.SystemPlugins/Program/IProgramSource.cs b/Plugins/Wox.Plugin.Program/IProgramSource.cs similarity index 96% rename from Wox.Plugin.SystemPlugins/Program/IProgramSource.cs rename to Plugins/Wox.Plugin.Program/IProgramSource.cs index edaebc8214..7f4eea517f 100644 --- a/Wox.Plugin.SystemPlugins/Program/IProgramSource.cs +++ b/Plugins/Wox.Plugin.Program/IProgramSource.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { public interface IProgramSource { diff --git a/Wox/Images/program.png b/Plugins/Wox.Plugin.Program/Images/program.png similarity index 100% rename from Wox/Images/program.png rename to Plugins/Wox.Plugin.Program/Images/program.png diff --git a/Plugins/Wox.Plugin.Program/Languages/en.xaml b/Plugins/Wox.Plugin.Program/Languages/en.xaml new file mode 100644 index 0000000000..4f5cb3aadc --- /dev/null +++ b/Plugins/Wox.Plugin.Program/Languages/en.xaml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/Wox.Plugin.SystemPlugins/Program/Program.cs b/Plugins/Wox.Plugin.Program/Program.cs similarity index 96% rename from Wox.Plugin.SystemPlugins/Program/Program.cs rename to Plugins/Wox.Plugin.Program/Program.cs index bcef7c4224..10257acdbe 100644 --- a/Wox.Plugin.SystemPlugins/Program/Program.cs +++ b/Plugins/Wox.Plugin.Program/Program.cs @@ -1,7 +1,7 @@ using System; using Wox.Infrastructure; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { [Serializable] public class Program diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramCacheStorage.cs b/Plugins/Wox.Plugin.Program/ProgramCacheStorage.cs similarity index 84% rename from Wox.Plugin.SystemPlugins/Program/ProgramCacheStorage.cs rename to Plugins/Wox.Plugin.Program/ProgramCacheStorage.cs index 8c28ab722d..b1baf51a16 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramCacheStorage.cs +++ b/Plugins/Wox.Plugin.Program/ProgramCacheStorage.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using Newtonsoft.Json; using Wox.Infrastructure.Storage; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { [Serializable] public class ProgramCacheStorage : BinaryStorage diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml b/Plugins/Wox.Plugin.Program/ProgramSetting.xaml similarity index 95% rename from Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml rename to Plugins/Wox.Plugin.Program/ProgramSetting.xaml index 6f00f4cd5c..f0cdad9b91 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml +++ b/Plugins/Wox.Plugin.Program/ProgramSetting.xaml @@ -1,10 +1,10 @@ - diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs b/Plugins/Wox.Plugin.Program/ProgramSetting.xaml.cs similarity index 98% rename from Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs rename to Plugins/Wox.Plugin.Program/ProgramSetting.xaml.cs index a1b750b428..4c103c7b8e 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs +++ b/Plugins/Wox.Plugin.Program/ProgramSetting.xaml.cs @@ -4,7 +4,7 @@ using System.Windows; using System.Windows.Controls; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { /// /// Interaction logic for ProgramSetting.xaml diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSources/AppPathsProgramSource.cs b/Plugins/Wox.Plugin.Program/ProgramSources/AppPathsProgramSource.cs similarity index 96% rename from Wox.Plugin.SystemPlugins/Program/ProgramSources/AppPathsProgramSource.cs rename to Plugins/Wox.Plugin.Program/ProgramSources/AppPathsProgramSource.cs index e6c67cc70d..ec2bec0512 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSources/AppPathsProgramSource.cs +++ b/Plugins/Wox.Plugin.Program/ProgramSources/AppPathsProgramSource.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.SystemPlugins.Program.ProgramSources +namespace Wox.Plugin.Program.ProgramSources { [Serializable] [global::System.ComponentModel.Browsable(false)] diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSources/CommonStartMenuProgramSource.cs b/Plugins/Wox.Plugin.Program/ProgramSources/CommonStartMenuProgramSource.cs similarity index 95% rename from Wox.Plugin.SystemPlugins/Program/ProgramSources/CommonStartMenuProgramSource.cs rename to Plugins/Wox.Plugin.Program/ProgramSources/CommonStartMenuProgramSource.cs index bbad137565..16f13dead1 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSources/CommonStartMenuProgramSource.cs +++ b/Plugins/Wox.Plugin.Program/ProgramSources/CommonStartMenuProgramSource.cs @@ -3,7 +3,7 @@ using System.Runtime.InteropServices; using System.Text; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.SystemPlugins.Program.ProgramSources +namespace Wox.Plugin.Program.ProgramSources { [Serializable] [global::System.ComponentModel.Browsable(false)] diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSources/FileSystemFolderSourceShallow.cs b/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemFolderSourceShallow.cs similarity index 100% rename from Wox.Plugin.SystemPlugins/Program/ProgramSources/FileSystemFolderSourceShallow.cs rename to Plugins/Wox.Plugin.Program/ProgramSources/FileSystemFolderSourceShallow.cs diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSources/FileSystemProgramSource.cs b/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs similarity index 94% rename from Wox.Plugin.SystemPlugins/Program/ProgramSources/FileSystemProgramSource.cs rename to Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs index 831bb5db42..dc24fead6b 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSources/FileSystemProgramSource.cs +++ b/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; -using log4net.Repository.Hierarchy; using Wox.Infrastructure.Storage.UserSettings; using Log = Wox.Infrastructure.Logger.Log; -namespace Wox.Plugin.SystemPlugins.Program.ProgramSources +namespace Wox.Plugin.Program.ProgramSources { [Serializable] public class FileSystemProgramSource : AbstractProgramSource diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSources/UserStartMenuProgramSource.cs b/Plugins/Wox.Plugin.Program/ProgramSources/UserStartMenuProgramSource.cs similarity index 91% rename from Wox.Plugin.SystemPlugins/Program/ProgramSources/UserStartMenuProgramSource.cs rename to Plugins/Wox.Plugin.Program/ProgramSources/UserStartMenuProgramSource.cs index b467fc46ba..9b3298f820 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSources/UserStartMenuProgramSource.cs +++ b/Plugins/Wox.Plugin.Program/ProgramSources/UserStartMenuProgramSource.cs @@ -1,7 +1,7 @@ using System; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.SystemPlugins.Program.ProgramSources +namespace Wox.Plugin.Program.ProgramSources { [Serializable] [global::System.ComponentModel.Browsable(false)] diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSuffixes.xaml b/Plugins/Wox.Plugin.Program/ProgramSuffixes.xaml similarity index 93% rename from Wox.Plugin.SystemPlugins/Program/ProgramSuffixes.xaml rename to Plugins/Wox.Plugin.Program/ProgramSuffixes.xaml index 82acfc2d29..9f46238b8e 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSuffixes.xaml +++ b/Plugins/Wox.Plugin.Program/ProgramSuffixes.xaml @@ -1,4 +1,4 @@ - /// ProgramSuffixes.xaml 的交互逻辑 diff --git a/Wox.Plugin.SystemPlugins/Program/Programs.cs b/Plugins/Wox.Plugin.Program/Programs.cs similarity index 88% rename from Wox.Plugin.SystemPlugins/Program/Programs.cs rename to Plugins/Wox.Plugin.Program/Programs.cs index f49bfcd38e..9e1c9c514f 100644 --- a/Wox.Plugin.SystemPlugins/Program/Programs.cs +++ b/Plugins/Wox.Plugin.Program/Programs.cs @@ -1,18 +1,14 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Linq; using System.Reflection; -using System.Runtime.Serialization.Formatters.Binary; -using System.Windows.Forms; using Wox.Infrastructure; using Wox.Infrastructure.Storage.UserSettings; -using Wox.Plugin.SystemPlugins.Program.ProgramSources; +using Wox.Plugin.Program.ProgramSources; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { - public class Programs : BaseSystemPlugin, ISettingProvider + public class Programs : ISettingProvider,IPlugin { private static object lockObject = new object(); private static List programs = new List(); @@ -25,7 +21,7 @@ namespace Wox.Plugin.SystemPlugins.Program }; private PluginInitContext context; - protected override List QueryInternal(Query query) + public List Query(Query query) { if (query.RawQuery.Trim().Length <= 1) return new List(); @@ -73,7 +69,7 @@ namespace Wox.Plugin.SystemPlugins.Program return false; } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; programs = ProgramCacheStorage.Instance.Programs; @@ -172,26 +168,6 @@ namespace Wox.Plugin.SystemPlugins.Program p.Score -= 20; } - public override string ID - { - get { return "791FC278BA414111B8D1886DFE447410"; } - } - - public override string Name - { - get { return "Programs"; } - } - - public override string IcoPath - { - get { return @"Images\program.png"; } - } - - public override string Description - { - get { return "Provide searching programs in your computer."; } - } - #region ISettingProvider Members public System.Windows.Controls.Control CreateSettingPanel() diff --git a/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c2465d39d9 --- /dev/null +++ b/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.Program")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.Program")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("82f60d9a-9280-4b6a-8b21-f3c694cb7e1d")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wox.Plugin.SystemPlugins/Program/StringEmptyConverter.cs b/Plugins/Wox.Plugin.Program/StringEmptyConverter.cs similarity index 94% rename from Wox.Plugin.SystemPlugins/Program/StringEmptyConverter.cs rename to Plugins/Wox.Plugin.Program/StringEmptyConverter.cs index c2d5366306..eb2e4b9c18 100644 --- a/Wox.Plugin.SystemPlugins/Program/StringEmptyConverter.cs +++ b/Plugins/Wox.Plugin.Program/StringEmptyConverter.cs @@ -2,7 +2,7 @@ using System.Windows.Data; using System.Windows.Markup; -namespace Wox.Plugin.SystemPlugins.Program +namespace Wox.Plugin.Program { public class StringEmptyConverter : MarkupExtension, IValueConverter { diff --git a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj new file mode 100644 index 0000000000..4b64f865ff --- /dev/null +++ b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj @@ -0,0 +1,124 @@ + + + + + Debug + AnyCPU + {FDB3555B-58EF-4AE6-B5F1-904719637AB4} + Library + Properties + Wox.Plugin.Program + Wox.Plugin.Program + v3.5 + 512 + ..\..\ + true + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.Program\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll + + + False + ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + ProgramSetting.xaml + + + + + + + ProgramSuffixes.xaml + + + + + + + + PreserveNewest + + + + + PreserveNewest + + + MSBuild:Compile + Designer + PreserveNewest + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Program/packages.config b/Plugins/Wox.Plugin.Program/packages.config new file mode 100644 index 0000000000..6c533b9f5c --- /dev/null +++ b/Plugins/Wox.Plugin.Program/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Program/plugin.json b/Plugins/Wox.Plugin.Program/plugin.json new file mode 100644 index 0000000000..9185aa7fe8 --- /dev/null +++ b/Plugins/Wox.Plugin.Program/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"791FC278BA414111B8D1886DFE447410", + "ActionKeyword":"*", + "Name":"Program", + "Description":"Provide programs search for Wox.", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.Program.dll", + "IcoPath":"Images\\program.png" +} diff --git a/Plugins/Wox.Plugin.Sys/Images/app.png b/Plugins/Wox.Plugin.Sys/Images/app.png new file mode 100644 index 0000000000000000000000000000000000000000..8c9ca7971a62d99905b25ef3fb3e435e1d1ceaca GIT binary patch literal 11524 zcmch7RZt#HwC&&)+#$FJclQw7?Ze&O-3jjQ?iL^fcPBUm3GVI$KAg*cpYOx1^KhoB zYftyQ%$Dj}d#xR*q#%imNPq|c0J5~yR}}z&_;`f?;9)iBD5sHC=?AtWaxVYq6QW=dXAL(VDJK>RBpsh0d1>=XjFuDw7M?O z1<6|ZFF)_g^YiDW=gz~N!Tn3AOXh(CQ6Kv?e~y&C2CE8G!fV$$2dfSNKgSrnbbzH zfKfc4UiGIbB9H)qusgvolbL?2HsWSu~H&yf|U~l`t{LuFD-%!z;&6NYW5ZU$STW1U;G=QcseYs+=zrP6OI08}c z)?-tt1FUEOmYa`y?5hX`+K4mWkI`N{FCxTwg-W9WM4u6nkj|-$3%gi$qlMntw;i^k z{qH}%zO8y+0Zv&WnYF#eA+JtG_U?5mafjp3VyyPyLyEVN?*XrIbhA4g4Y~~2QP-fz zRwZ)z5wA9t#IIyysXG|Q0c_VKX|D*$9>_pVm}0L&Gu*Fn+g|?*2*_v@(40FU;(yB+ zLx7YBpjmLRd4T~Sx#uxngdPHzOfT65fX*X4-HH@kxnXz!_*xM3rCt>7Qy*4MFG@}y zQD-kMq!H{_kx!Jp0%&5edx4)33-QuK@zr|ymZ5*uLlG39XKkZ3^|A6GA8ujj2Aw+M z!W!b`_2YGhAwY|c!ebhd@kO8;$1Rgj!Q*DeL6aLvaU=znkRC^1DU%P4I+s9JidiS> zNm1M|I%Dz1>WVxitd5ehMZH9IO0uQ|H7Y~>fpimTs~{nW8ZK~|b>%?S3rs7rnI&i< z77T1IDxZ}-a&razqT);fXIW9qWBwZH#)L~4MuG^aM{rE`L7W=#oF+sdZg*_L-aMmA zcuL6VK+H3E{ZO=i+u(!*Nst^!yn^bCq6woNUK1fCl(nCRJh?)#iOL(}anRG4uOR{S zt%mx7jF>EsN}mP=(;!)j5@jrDPXUpPDuGQJN!mtgRf@4hwM1wR%_>KZ`ZU3AY-10; zF|dX-J+UPLH9;}yd2C>>1&ePeVn+_4h*G5_1w)3@On4uGMiuZ4h%oN!a@{|uF6r(U>!=iPqd98mf_loyQ_lohk z^EuA>>B^;>W3EUpL+%})9Us^Yp`EK;x&3?ls@wF5(7eg1*D=D~?>m&^^;yX~yMM)Z zxF?s3m$M|?EFAD$3HY|GJSJBY2_{E28CI>cSE1V#=;M~{iG!BKv(m*ht<)Fc7Q39D zxI*SN4xf!{I5y1IYy^yqt=Lve21|zay6GlUY_iPTXPf3-CniQ2)@qh(#?In+7jkU! zjJp4JuD-;6FO|p{l8NSu9!XnC^BsptlTQQJWM~L!cxl{eEY(Oa>Yg&3+AV6@DiLaC zf6C^|9&fIw&8{7E&$ipd+QEvao1?o^wO?U9dpScq%Q}NS=e;+&r@FVhpC+34j6t-> z@5=A%?CLh*ZtK{2TC&YCP&rsRaI9%TXi?~rd&`MiCYvyhk?x+3t7=ysRc@c}J)XKx zaM3>ZYyPe{yCZw8_OIQa^$Ectzv^dsrfkA7y#c{X(SKK9(2mo@Zf<#YdH-#~A+x@_ zzLx%T7qQ~c9O}G97Q4~aL7lCxaUVlIAwjdJsbeUiVIjzT@BHxYvTpKC!EOrwMgL5H zxR<gFp+@$L2Iu+^%BVewUjqZc?dJLcx(^uAukS!PD_d${&w<6 zffS76+m%qS)LQ>@xz$tadW*bAq63E_S{2uWiB(Uf-PF_SYR+%ma=bC^RcQyLqJCrT zwRRJy5;9j>Do!7)$&p%_GB$2s_fNac1luUpRQ=LAeL+Vf;0tc5L5*WgMcqUFx7LFl zO$CDm-#ah6m6Z*dmfz>6Ql}-S_BCLwo*yz@)}jkDVOPktgx9hAga&pp8?J@k)^~A} zO_RSTp*W2=&vho6YgTUxxr*<-a|86oHC}70Te|;JuPpYgd-&X#?>X>aZxEp40eI|o<1k+Ds?+fwIoNoWsztU|uuf3Y-|=-@>W7ZQsTp|u zTvMRV^`HDH|Lo;_z>{_Fg3Hpw5|duOSJ&n68DWb(_4?;ls`k4F_xp2P55x<(H9hZm z&mS+{E3YSTPpBsWO>Yfmy>?p?mWv*gI<=ekRGF_d+NL@Z=ElzD}V5fP>hgt zPI(Dlm%Y?Zt@>TIUbb(JbdhAzzKFaj-OfIljFitPf`tx!-(Hx(p|{UebNTEaXp_`L zN<|(3yr}>nFa!V|-#_dz0JyOLz=h$aR>8ma`qlVJg3|9{)iFB-+dq|z!P;K`MTuX#kY35HsLbau69 zR5Ga+l_f^__nhhq46KSQ#Sk?*s}l|Bfrf+OMZfaySCIhH9*d^DaMK4kS9p=x)qsd3 z@~(8*gzidFeZvN=c}guv4uC;UY#1X6S_%UzUNVT9Xp!=cXe_?xtnH<4;4lZkdfo2e z+QZ!-wYgbu)XSrgX5)|uDy#5CAI-pp95W6wO)d2H%dM*FK3MWaz3e%=xN#8!qBi`T z%ZA8=$+c?6DW!u?Ze3;&@GY6f*eE-&t$SM3)tkbbR2Mm^TGkJcbRaT1j3#4os?VLG z*Yj$;J3kwVeLYB#fHlRh+I$b2KJD;(k6K_fq5&ib^B;nS%mYA4l+_2CJXN7bU*qb< zkHKe)TWy68M zWhEg4$|=%}AqdGvi=~v#c?r!3J-O~D z*l+D!oqsPl-Z5T8mG`+5>Y)5foP55BRriR%ssrttV7C~M-Ew_AF0KNQ?gmzL$*D0h8@tDc_8X~MG*L9?T z)ZAm1*a!(3g)zkP8IIJPIvE*&{-sRo^SvqcJsO*ec_1Rv9ulxC#6196@OuvCGrHKf z8F(diOA-I=@SaHo2$Dd7XmPPoDa1fn=_D1iAB;Z#U_|DOK@%YfiFZ&^?$wmyk$7$p z38Xqa!{`3+FnMO(|vr;rr2(Nk9qzZsJAENGZPR6_or?U$b_nh96q? ziVaWFyU47XJ0t=#L`1{#RR=FUE0urFl^~AvaL%6Xg!I&KU73t;kLy4N$%Ow_6RDS`&O60} zD_m}bVUiZD+g(@f^BZUN%%8(mN-Yq;#qs$tTdrRR01W*m3ll6QMb!j$h?Lte9%U|U zDKkO6CSmO8I93na$G6Y*u@EBv9%&NJ14{0fgtlgS&u$L+XW(D!H+o%}CLo z&cF+LncuL#Te9cE5P~5c2Ny=QaDpcy6^0ofZP zQ6eNACrWE7rO(|>6(H3-VOBOAuZFSW4b;E02*!|G_B*ynrOZ{7+d*`=+nL{&jQp)H zaBp;t&(K?ao=QFKwtGUqB7hSZ5bo{QmDj;vwa!Ob3n}lDQaTfkLSiaB3r}VE=zzk( z7Iq6`uf=~x$@7gxm<{F^RmzG+NYW6?`_}NI0$Ic+FXMu&)MkI){mX47tp8le669AE zj4h35;fhhN4CRjO=3ci7@TNmLa@qN#T6e65G}{w918&~$A)-O-qO@Iq&-eFGIgM@6 z+v^mG_Cs{Vn!j9ibG;_owarF`=#IvGp!P|5EHJ>>|~it&)E1%~nT%8m20;PSaW0q13le3Fy= z3gv`A@r$l(0JnSdl5val)E}N)NR|}|U2zSdx%FiB6ihBN;sxLk8Kv zV{hZID?#^YY)oaCO6vl@UZA35^-J*7&Tp6O!M5-gQtQ z#^clmtD@+RQn-O??z))%RU*O|&fp3JGOzJKDRfeX@B@vMMpX#R&P4@)8rTD-_VOpu ztY`O;wQd$G)zNMa0ef6rkvDcsQ$fmq6(A?SNe#o}Di66(jNKrMtjSFpb)LyA5Wku(wwWIp}55=0Go& z9CMeY8!J7ojqYjWUwbDnM5#wUZa$N5t)lvs*rX_8uTqM8i`e|}oNOGt9DrD~lSpFo zvOmsh3BhAlov{0J9W#fq*TGb7=*NM6;cB)W>?{`?ah^}96*-HrlW*_oL#g!BcayPJ z>HZ~qD_Y5rmUKuKto108TEF%73uy#LgnCk=PC7eeELugFZk5k?FbXhtdZ`72*_X{m{Z1YzP%{X;Hk=RnB%FE(X# z=bQx68BCUa95Ai(tXLj$AUurKf{%al7xXCIRjN@wh$1BmVQRTL>Y8!+*4jQJ z5<}#Ry;hP|!8mfcV>*E?d(+(e5zWl->JBv49sDyZo3+myoy(?c{7#95hwp{HaDM>A zGE<&ibh;yW-NYmsUD2x6Hbgj|61? z{pd$F4?C0HvQ2k7H|lXPdWlaKeZ!BARLFvK;{0xw*-u1y53+8y>k(|~TSNGt64S@_ zk2x7(4L@pvNh;s+Wb=Kg$}c4B{^HzzsJ3HM#4o-zaDSL`yAa<1#nV9y>MD5->~@)> zo5+itMi$DtiXL0-VuAFUR%P|@8mULd-O?`x=<|i|oX;%eo^}d8*k5N?oM5~YFv*OM*!}$pWv|)Qf?F-S z5jIZo##G9`+rZ{^RXQ8h6j_h(gy7DR%aLQrVGbkWu+ed(v8BFC4L5Xcmdx175@;q; zXb8ytlqT!Nq%d(ZYWKoPD5~^)TE_W@1fpT=_FvO}!Krf1v3mIRLSBM5Dp7Idv0FHh z?fN|}H$REJl@K1-;F_Z>>_D*0TrxS^WLRRKtk-&c`&BVa%g&y?+ALzw}Mp zu9fdRT4RpUOF|4idA-~JrLK|3^e~O{GjxG;`52*Hv`E@OWER=ZzGf*de2y5;JyBj&dOG>AP0tQ&kEAh)w_OsFl0wJ{~li?6L@H`HA$p z)G`9(oK0!s6t=uH{iCYY4}AKNH+4?0l~m8eE2)_+0aGwlfJ!>PJ*Yy|r}!F$+9Oa8 z!HwM$^j<57g=Mj*!&%zDq@QFgU~c61>w(o(b!Ws+V?bD?d8?W35NX|`q!>ame+75$ z|K^W3u%^;VJOgYXolU9xa+@5sOMB{O)Y2gh-Y$)Hg|3&2i@}`g+_S-W?>J- zA5=ReBnZo^e@AhogjL<|`@sgn>htyYpJ0UlmNJLBxT};oGCWtgHuMvIxHHKIRos1) zkG5I(P*S+o6r3rpt(_Hy3ZuxY;4zHvpErIfkr`*Q(4A!vYM`hSb9#G-sQ11%tEgnx zuM!Ih^cGk0l-+*nL~x>mQs|aWbfT3)qhC{+b4E0?P}^W!XuEJ-`3z!cC3I{k5U*=n zT3!+sCjXXx>k=Lm!`IcRri%DuhvdE;K3bkfA%M1-`}C(Z(_{uY7H50yHS~sc9ej8t zHZdds5V{iM;utk-cP=w`AAuFRK+BI{?Yl$z<})Ym<0)AX)0J5drBSCN?+srFFEFk` zb8=IZ4sMQL#?$m^Z|K&Zz-5`Te*w~42;v8RWa*@>7C&77iOk(*tL>KrHmvGI(lzss z`A-=nx2jTnx6j*l>!^Lts-D+++~|ZjPIUutOZPqzj`;g0wf?N%C;%qp(3o`=PQh^x zZ+A4c>S9Y~nT`am*_$DA_u8tf?zFYCm)JDXmD(%^VhkhYef> zlui$w(s@+04}Zo7&R|VXXtlli4cW$^iOi;DR!_e9=6JYs6{(U=kxiCh=GeS=QfD5A3%ygt*K5v`V0ehp12lz$=yB?#I_JI~w`I)=B3^+(JkDbNq8R7S~xwI31>d zG^k*gcKm9j@UPeD?PpQ)cg&=JOu|#&6xZIn7qgW4o5V_TBdHMp;HC1SzOegT(-)-L z4Ye%=LJ;|gvwiL_h>M&Xsu#xtjP3LQlk-`l5N>yvdQPr@gsK6UU<47s)!{pV_Vj&> z{)u(WB=OR6BQrTCHU>ifOsvmN8kwNE<3zF~o)hr-<|LSnwf*_pg80NrGIOfY zsH$vxY_d=0zxS$dsg`(n zik-xUSjg`2n+T5#0!)4x^8FlO^EM-I{6t)fbJaL-BBBt}ogC3< zjKRtdPeY&zgl&Nw!Y}+h(c|1Xj+`M=!EQyZr7~a_>cLWD`EA6SJnux5`9I;cMARU_ zKVIpvHf0pAMsAES^*R@Q@Qb|o^=)N3spw&YJqG0(mk|VvA?3AA)^<#55YJ5EW?ypy zS$%EsaU_2K9XzllqQfXa9hqmToE$Kg$^PZ^9XoSg@}-U2Om3hbK>e1Po)ztzT!cXf z1arWWiJHl-(yfDiXS@-+D7F|@(F03a@fd?6za;O@*R!~YR1CX|wVWr8LEJ3n(A=J-{ zEM!j-aay7lSXR=KaOSbxf$xtTskJHbxy>g(C$hdO_en%FMdi+V&aDT_!+J<`=kh|O zo651)zK*k(Q_P+e05Q<&)Wos1)&xSw@N1At9LTE#A<3MF$}gZz;|m8|56;sn`%cQ@ z-WjLEqGTt1nYydH9>M0JnOi1lym%etnrAp&1(01U?PZF>76#$ zGe7Z)DA&s5gu3RNjxPY90}bX~^YH}mbh2XtjAYxj<(y=4C)?X8M2~xr`Cv|~A0=8@ zga-b(Q)&^lIxL#?E3_hdAYJg^JM~V>)~{U8oMA`cI4)Oag$ebbX2l($l}{Qy9I+t= zlCHzbn&cDjwGfWWTTM@yyPO^@fm`dTq{f8#`3PrADALILjR!(p>UtYXKC9Ba&r4LZ zDAeQ0_{AfE&jK`$wq}FsWiW`d+CEt+4@eT+(+j=$Zf-h`NltIS`CT5boakk8Qq=fD zY|{hOp2P8N1hadm?4^R{p(lA`&1G9@yDK&95o1OTI~L!^9pz8H4ov4^V8;tjb-=a- z|3W+Q(QWm)cRWzPhjIUg(;H8;pBh| zQk|r^Yw*=x&ree#1$^4p>)4n|5Lx}ukt+7f&DOUw9(rtVRUhQ4jv*JNx-q&>*{uNm zFiSZ9B)#|cjnC}vZLbx({acr#G53o6+A~Q6tOGOGB5_|T?@!lti$v3!Jb#4lJcH19 zg5THnyH1~p_G)@RctS7q20YyDuL^1c8fMcNLhoA>V+JI>vySCji8;}$NK9Dm_tyg? zJH?{S(%`0?k5)_h?;t!)UVZ>$TpNM%>ZzF94zeWa6b_)UlDVQ zFekEM&8d=;jWg-`d&pH7D&N*C-}5103LX`PlkrH9$8kV7D}C2mM**Up3-|U_FF=h*?82c@ZnG5c0>hl7O2X z^TAk&C->Bq4}1iiMF>im5o`5=|G;`soFA zKy*5P@uX?B1~zJhXgzDggg>uZ)AlpswPKU_JNeT4H+l$aKTW)9d#MZSS1pH}x_8D{ zAS=Agzj!}k6w>z0`@LlkWPe|Jg}Uz9?{M9R&v`tvP(0(P?Oe^k4kWS*I=pnK;*Yvx zOck};d|x0M#*`Ei3orK=H5;WU&AxIr(HgzK4JZ25YII2N`QspgZt*|5y8Gv@dQBxm z*mQ}s(nm>rx7tY!ee-r^=4!&P-f5~Ug;XSZ1Zn150(pEl4cmOM=9p46k?+hf6p=0@_P(sO_wT=0!y|j zKC~~2aLRE&Y2W@nH9QcefJmiNNLV5;0UbNA5tF;tJ-!_P?Q}kKN(g?@X)6>N9i;^d zsyqi$7D8u9mc8D3z|vXG`i&qSmQZM)3msG1*A1M7&1Wa6kGa2xn%~j>@k@+jy0B;% zY7q6>h1Q-no4-l&5b+_FdtC3()s+p>&$;5z$V7FXWtF-1zV?Gd#gcp8jk6Ko}c5^9+)pQ7b8vdWatFmg%7@ZGfjtT2JaM9>6`N`Ykpyem;VJ@&gZVuQnJRqOFqqEfzm2y z$SA$AD*p|l>Zy`g32QVX;~e8-uE6wh{*eMAYFZOcUFQFQxsD^k@XFw*X+copRvBBU%jjc%&s1zSfBu2LB(F!ORT+ literal 0 HcmV?d00001 diff --git a/Wox/Images/close.png b/Plugins/Wox.Plugin.Sys/Images/close.png similarity index 100% rename from Wox/Images/close.png rename to Plugins/Wox.Plugin.Sys/Images/close.png diff --git a/Wox/Images/exit.png b/Plugins/Wox.Plugin.Sys/Images/exit.png similarity index 100% rename from Wox/Images/exit.png rename to Plugins/Wox.Plugin.Sys/Images/exit.png diff --git a/Wox/Images/lock.png b/Plugins/Wox.Plugin.Sys/Images/lock.png similarity index 100% rename from Wox/Images/lock.png rename to Plugins/Wox.Plugin.Sys/Images/lock.png diff --git a/Wox/Images/logoff.png b/Plugins/Wox.Plugin.Sys/Images/logoff.png similarity index 100% rename from Wox/Images/logoff.png rename to Plugins/Wox.Plugin.Sys/Images/logoff.png diff --git a/Wox/Images/restart.png b/Plugins/Wox.Plugin.Sys/Images/restart.png similarity index 100% rename from Wox/Images/restart.png rename to Plugins/Wox.Plugin.Sys/Images/restart.png diff --git a/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c0e3221b08 --- /dev/null +++ b/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.Sys")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.Sys")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("e1eecff6-3f25-424d-9bbd-cbd7d6e1e11e")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wox.Plugin.SystemPlugins/Sys/Sys.cs b/Plugins/Wox.Plugin.Sys/Sys.cs similarity index 80% rename from Wox.Plugin.SystemPlugins/Sys/Sys.cs rename to Plugins/Wox.Plugin.Sys/Sys.cs index 50a2a6e859..69f7646e24 100644 --- a/Wox.Plugin.SystemPlugins/Sys/Sys.cs +++ b/Plugins/Wox.Plugin.Sys/Sys.cs @@ -1,14 +1,11 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; using System.Windows.Forms; -namespace Wox.Plugin.SystemPlugins.Sys +namespace Wox.Plugin.Sys { - public class Sys : BaseSystemPlugin, ISettingProvider + public class Sys : IPlugin, ISettingProvider { List availableResults = new List(); @@ -27,36 +24,12 @@ namespace Wox.Plugin.SystemPlugins.Sys #endregion - #region Overrides - - public override string ID - { - get { return "CEA08895D2544B019B2E9C5009600DF4"; } - } - - public override string Name - { - get { return "System Commands"; } - } - - public override string IcoPath - { - get { return @"Images\lock.png"; } - } - - public override string Description - { - get { return "Provide System related commands. e.g. shutdown,lock,setting etc."; } - } - - #endregion - public System.Windows.Controls.Control CreateSettingPanel() { return new SysSettings(availableResults); } - protected override List QueryInternal(Query query) + public List Query(Query query) { if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List(); @@ -72,7 +45,7 @@ namespace Wox.Plugin.SystemPlugins.Sys return results; } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { availableResults.AddRange(new Result[] { new Result diff --git a/Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml b/Plugins/Wox.Plugin.Sys/SysSettings.xaml similarity index 94% rename from Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml rename to Plugins/Wox.Plugin.Sys/SysSettings.xaml index 0ef8c5e05f..09de8f3709 100644 --- a/Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml +++ b/Plugins/Wox.Plugin.Sys/SysSettings.xaml @@ -1,4 +1,4 @@ - + /// Interaction logic for SysSettings.xaml + /// + public partial class SysSettings : UserControl { + public SysSettings(List Results) { + InitializeComponent(); + + foreach (var Result in Results) { + this.lbxCommands.Items.Add(Result); + } + } + } +} diff --git a/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj b/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj new file mode 100644 index 0000000000..b7e956920d --- /dev/null +++ b/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj @@ -0,0 +1,123 @@ + + + + + Debug + AnyCPU + {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} + Library + Properties + Wox.Plugin.Sys + Wox.Plugin.Sys + v3.5 + 512 + ..\..\ + true + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.Sys\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll + + + + + + + + + + + + + + + + + SysSettings.xaml + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + MSBuild:Compile + Designer + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Sys/packages.config b/Plugins/Wox.Plugin.Sys/packages.config new file mode 100644 index 0000000000..7eb67aa24b --- /dev/null +++ b/Plugins/Wox.Plugin.Sys/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Sys/plugin.json b/Plugins/Wox.Plugin.Sys/plugin.json new file mode 100644 index 0000000000..9d0055e1c2 --- /dev/null +++ b/Plugins/Wox.Plugin.Sys/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"CEA08895D2544B019B2E9C5009600DF4", + "ActionKeyword":"*", + "Name":"System Commands", + "Description":"Provide System related commands. e.g. shutdown,lock,setting etc.", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.Sys.dll", + "IcoPath":"Images\\lock.png" +} diff --git a/Wox/Images/url.png b/Plugins/Wox.Plugin.Url/Images/url.png similarity index 100% rename from Wox/Images/url.png rename to Plugins/Wox.Plugin.Url/Images/url.png diff --git a/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..894c83bff0 --- /dev/null +++ b/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.Url")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.Url")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("ea42b60d-34ff-4656-8ee1-012afa397d3e")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wox.Plugin.SystemPlugins/UrlPlugin.cs b/Plugins/Wox.Plugin.Url/UrlPlugin.cs similarity index 83% rename from Wox.Plugin.SystemPlugins/UrlPlugin.cs rename to Plugins/Wox.Plugin.Url/UrlPlugin.cs index 0ba5080ad0..e578e7c253 100644 --- a/Wox.Plugin.SystemPlugins/UrlPlugin.cs +++ b/Plugins/Wox.Plugin.Url/UrlPlugin.cs @@ -1,15 +1,12 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Net; -using System.Security.Policy; using System.Text.RegularExpressions; using System.Windows; -namespace Wox.Plugin.SystemPlugins +namespace Wox.Plugin.Url { - public class UrlPlugin : BaseSystemPlugin + public class UrlPlugin : IPlugin { //based on https://gist.github.com/dperini/729294 private const string urlPattern ="^" + @@ -46,8 +43,10 @@ namespace Wox.Plugin.SystemPlugins "$"; Regex reg = new Regex(urlPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - protected override List QueryInternal(Query query) + public List Query(Query query) { + if(string.IsNullOrEmpty(query.RawQuery)) return new List(); + var raw = query.RawQuery; if (IsURL(raw)) { @@ -99,17 +98,9 @@ namespace Wox.Plugin.SystemPlugins return false; } - public override string ID + public void Init(PluginInitContext context) { - get { return "0308FD86DE0A4DEE8D62B9B535370992"; } - } - public override string Name { get { return "URL handler"; } } - public override string Description { get { return "Provide Opening the typed URL from Wox."; } } - public override string IcoPath { get { return "Images/url.png"; } } - - protected override void InitInternal(PluginInitContext context) - { } } } \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj b/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj new file mode 100644 index 0000000000..a3e27ea2fa --- /dev/null +++ b/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {A3DCCBCA-ACC1-421D-B16E-210896234C26} + Library + Properties + Wox.Plugin.Url + Wox.Plugin.Url + v3.5 + 512 + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.Url\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + PreserveNewest + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Url/plugin.json b/Plugins/Wox.Plugin.Url/plugin.json new file mode 100644 index 0000000000..e4558f1c14 --- /dev/null +++ b/Plugins/Wox.Plugin.Url/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"0308FD86DE0A4DEE8D62B9B535370992", + "ActionKeyword":"*", + "Name":"URL handler", + "Description":"Provide Opening the typed URL from Wox.", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.Url.dll", + "IcoPath":"Images\\url.png" +} diff --git a/Wox/Images/web_search.png b/Plugins/Wox.Plugin.WebSearch/Images/web_search.png similarity index 100% rename from Wox/Images/web_search.png rename to Plugins/Wox.Plugin.WebSearch/Images/web_search.png diff --git a/Wox/Images/websearch/google.png b/Plugins/Wox.Plugin.WebSearch/Images/websearch/google.png similarity index 100% rename from Wox/Images/websearch/google.png rename to Plugins/Wox.Plugin.WebSearch/Images/websearch/google.png diff --git a/Wox/Images/websearch/pictures.png b/Plugins/Wox.Plugin.WebSearch/Images/websearch/pictures.png similarity index 100% rename from Wox/Images/websearch/pictures.png rename to Plugins/Wox.Plugin.WebSearch/Images/websearch/pictures.png diff --git a/Wox/Images/websearch/wiki.png b/Plugins/Wox.Plugin.WebSearch/Images/websearch/wiki.png similarity index 100% rename from Wox/Images/websearch/wiki.png rename to Plugins/Wox.Plugin.WebSearch/Images/websearch/wiki.png diff --git a/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..23f84e286a --- /dev/null +++ b/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.Plugin.WebSearch")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.Plugin.WebSearch")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("42c17706-44ba-4549-ab66-7bd994706cd1")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wox.Plugin.SystemPlugins/SuggestionSources/Baidu.cs b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/Baidu.cs similarity index 86% rename from Wox.Plugin.SystemPlugins/SuggestionSources/Baidu.cs rename to Plugins/Wox.Plugin.WebSearch/SuggestionSources/Baidu.cs index edb81bcddd..6603b59ba2 100644 --- a/Wox.Plugin.SystemPlugins/SuggestionSources/Baidu.cs +++ b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/Baidu.cs @@ -1,18 +1,12 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Xml; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; -using Wox.Infrastructure; using Wox.Infrastructure.Http; -using YAMP.Numerics; -namespace Wox.Plugin.SystemPlugins.SuggestionSources +namespace Wox.Plugin.WebSearch.SuggestionSources { public class Baidu : AbstractSuggestionSource { diff --git a/Wox.Plugin.SystemPlugins/SuggestionSources/Google.cs b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/Google.cs similarity index 84% rename from Wox.Plugin.SystemPlugins/SuggestionSources/Google.cs rename to Plugins/Wox.Plugin.WebSearch/SuggestionSources/Google.cs index e0ad8e0458..b74a278a2e 100644 --- a/Wox.Plugin.SystemPlugins/SuggestionSources/Google.cs +++ b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/Google.cs @@ -1,17 +1,11 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text; -using System.Xml; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; -using Wox.Infrastructure; using Wox.Infrastructure.Http; -using YAMP.Numerics; -namespace Wox.Plugin.SystemPlugins.SuggestionSources +namespace Wox.Plugin.WebSearch.SuggestionSources { public class Google : AbstractSuggestionSource { diff --git a/Wox.Plugin.SystemPlugins/SuggestionSources/ISuggestionSource.cs b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/ISuggestionSource.cs similarity index 56% rename from Wox.Plugin.SystemPlugins/SuggestionSources/ISuggestionSource.cs rename to Plugins/Wox.Plugin.WebSearch/SuggestionSources/ISuggestionSource.cs index 255ee40773..dd4b82fb6c 100644 --- a/Wox.Plugin.SystemPlugins/SuggestionSources/ISuggestionSource.cs +++ b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/ISuggestionSource.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography.X509Certificates; -using System.Text; +using System.Collections.Generic; -namespace Wox.Plugin.SystemPlugins.SuggestionSources +namespace Wox.Plugin.WebSearch.SuggestionSources { public interface ISuggestionSource { diff --git a/Wox.Plugin.SystemPlugins/SuggestionSources/SuggestionSourceFactory.cs b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/SuggestionSourceFactory.cs similarity index 74% rename from Wox.Plugin.SystemPlugins/SuggestionSources/SuggestionSourceFactory.cs rename to Plugins/Wox.Plugin.WebSearch/SuggestionSources/SuggestionSourceFactory.cs index 3262320b94..000cec8f72 100644 --- a/Wox.Plugin.SystemPlugins/SuggestionSources/SuggestionSourceFactory.cs +++ b/Plugins/Wox.Plugin.WebSearch/SuggestionSources/SuggestionSourceFactory.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Wox.Plugin.SystemPlugins.SuggestionSources +namespace Wox.Plugin.WebSearch.SuggestionSources { public class SuggestionSourceFactory { diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs similarity index 78% rename from Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs rename to Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs index 67e1687055..87156b69db 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchPlugin.cs +++ b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs @@ -1,25 +1,21 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Linq; -using Newtonsoft.Json; -using Wox.Infrastructure; -using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; -using Wox.Plugin.SystemPlugins.SuggestionSources; +using Wox.Plugin.WebSearch.SuggestionSources; -namespace Wox.Plugin.SystemPlugins +namespace Wox.Plugin.WebSearch { - public class WebSearchPlugin : BaseSystemPlugin, ISettingProvider + public class WebSearchPlugin : IPlugin, ISettingProvider { private PluginInitContext context; - protected override List QueryInternal(Query query) + public List Query(Query query) { List results = new List(); - WebSearch webSearch = + Infrastructure.Storage.UserSettings.WebSearch webSearch = UserSettingStorage.Instance.WebSearches.FirstOrDefault(o => o.ActionWord == query.ActionName && o.Enabled); if (webSearch != null) @@ -78,7 +74,7 @@ namespace Wox.Plugin.SystemPlugins return results; } - protected override void InitInternal(PluginInitContext context) + public void Init(PluginInitContext context) { this.context = context; @@ -86,26 +82,6 @@ namespace Wox.Plugin.SystemPlugins UserSettingStorage.Instance.WebSearches = UserSettingStorage.Instance.LoadDefaultWebSearches(); } - public override string ID - { - get { return "565B73353DBF4806919830B9202EE3BF"; } - } - - public override string Name - { - get { return "Web Searches"; } - } - - public override string IcoPath - { - get { return @"Images\web_search.png"; } - } - - public override string Description - { - get { return "Provide the web search ability."; } - } - #region ISettingProvider Members public System.Windows.Controls.Control CreateSettingPanel() diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml b/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml similarity index 97% rename from Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml rename to Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml index 31635038a0..2ffc409d66 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchSetting.xaml +++ b/Plugins/Wox.Plugin.WebSearch/WebSearchSetting.xaml @@ -1,4 +1,4 @@ - o == webSearch); if (updateWebSearch == null || string.IsNullOrEmpty(updateWebSearch.Url)) @@ -99,7 +89,7 @@ namespace Wox.Plugin.SystemPlugins MessageBox.Show("ActionWord has existed, please input a new one."); return; } - UserSettingStorage.Instance.WebSearches.Add(new WebSearch() + UserSettingStorage.Instance.WebSearches.Add(new Infrastructure.Storage.UserSettings.WebSearch() { ActionWord = action, Enabled = cbEnable.IsChecked ?? false, @@ -133,10 +123,10 @@ namespace Wox.Plugin.SystemPlugins if(!Directory.Exists(defaultWebSearchImageDirectory)) { defaultWebSearchImageDirectory = - System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath); + Path.GetDirectoryName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); } - var dlg = new Microsoft.Win32.OpenFileDialog + var dlg = new OpenFileDialog { InitialDirectory = defaultWebSearchImageDirectory, Filter ="Image files (*.jpg, *.jpeg, *.gif, *.png, *.bmp) |*.jpg; *.jpeg; *.gif; *.png; *.bmp" diff --git a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml b/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml similarity index 97% rename from Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml rename to Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml index 8e24a5993e..be59621a3d 100644 --- a/Wox.Plugin.SystemPlugins/WebSearch/WebSearchesSetting.xaml +++ b/Plugins/Wox.Plugin.WebSearch/WebSearchesSetting.xaml @@ -1,4 +1,4 @@ - /// Interaction logic for WebSearchesSetting.xaml @@ -54,7 +54,7 @@ namespace Wox.Plugin.SystemPlugins private void btnDeleteWebSearch_OnClick(object sender, RoutedEventArgs e) { - WebSearch selectedWebSearch = webSearchView.SelectedItem as WebSearch; + Infrastructure.Storage.UserSettings.WebSearch selectedWebSearch = webSearchView.SelectedItem as Infrastructure.Storage.UserSettings.WebSearch; if (selectedWebSearch != null) { if (MessageBox.Show("Are your sure to delete " + selectedWebSearch.Title, "Delete WebSearch", @@ -72,7 +72,7 @@ namespace Wox.Plugin.SystemPlugins private void btnEditWebSearch_OnClick(object sender, RoutedEventArgs e) { - WebSearch selectedWebSearch = webSearchView.SelectedItem as WebSearch; + Infrastructure.Storage.UserSettings.WebSearch selectedWebSearch = webSearchView.SelectedItem as Infrastructure.Storage.UserSettings.WebSearch; if (selectedWebSearch != null) { WebSearchSetting webSearch = new WebSearchSetting(this); diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj new file mode 100644 index 0000000000..f40eaa65f0 --- /dev/null +++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj @@ -0,0 +1,125 @@ + + + + + Debug + AnyCPU + {403B57F2-1856-4FC7-8A24-36AB346B763E} + Library + Properties + Wox.Plugin.WebSearch + Wox.Plugin.WebSearch + v3.5 + 512 + ..\..\ + true + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.WebSearch\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll + + + False + ..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + WebSearchesSetting.xaml + + + + WebSearchSetting.xaml + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.WebSearch/packages.config b/Plugins/Wox.Plugin.WebSearch/packages.config new file mode 100644 index 0000000000..6c533b9f5c --- /dev/null +++ b/Plugins/Wox.Plugin.WebSearch/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.WebSearch/plugin.json b/Plugins/Wox.Plugin.WebSearch/plugin.json new file mode 100644 index 0000000000..e1bb0fb631 --- /dev/null +++ b/Plugins/Wox.Plugin.WebSearch/plugin.json @@ -0,0 +1,12 @@ +{ + "ID":"565B73353DBF4806919830B9202EE3BF", + "ActionKeyword":"*", + "Name":"Web Searches", + "Description":"Provide the web search ability.", + "Author":"qianlifeng", + "Version":"1.0.0", + "Language":"csharp", + "Website":"http://www.getwox.com/plugin", + "ExecuteFileName":"Wox.Plugin.WebSearch.dll", + "IcoPath":"Images\\web_search.png" +} diff --git a/Wox.Core/Exception/WoxI18nException.cs b/Wox.Core/Exception/WoxI18nException.cs new file mode 100644 index 0000000000..e095c78995 --- /dev/null +++ b/Wox.Core/Exception/WoxI18nException.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wox.Core.Exception +{ + public class WoxI18nException:WoxException + { + public WoxI18nException(string msg) : base(msg) + { + } + } +} diff --git a/Wox.Core/Plugin/CSharpPluginLoader.cs b/Wox.Core/Plugin/CSharpPluginLoader.cs index 5910a6bebf..9ca8c9dfbc 100644 --- a/Wox.Core/Plugin/CSharpPluginLoader.cs +++ b/Wox.Core/Plugin/CSharpPluginLoader.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Reflection; using Wox.Infrastructure.Logger; using Wox.Plugin; -using Wox.Plugin.SystemPlugins; +//using Wox.Plugin.SystemPlugins; namespace Wox.Core.Plugin { @@ -20,7 +20,7 @@ namespace Wox.Core.Plugin try { Assembly asm = Assembly.Load(AssemblyName.GetAssemblyName(metadata.ExecuteFilePath)); - List types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && (o.BaseType == typeof(BaseSystemPlugin) || o.GetInterfaces().Contains(typeof(IPlugin)))).ToList(); + List types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IPlugin))).ToList(); if (types.Count == 0) { Log.Warn(string.Format("Couldn't load plugin {0}: didn't find the class that implement IPlugin", metadata.Name)); @@ -35,11 +35,11 @@ namespace Wox.Core.Plugin Metadata = metadata }; - var sys = pair.Plugin as BaseSystemPlugin; - if (sys != null) - { - sys.PluginDirectory = metadata.PluginDirectory; - } + //var sys = pair.Plugin as BaseSystemPlugin; + //if (sys != null) + //{ + // sys.PluginDirectory = metadata.PluginDirectory; + //} plugins.Add(pair); } diff --git a/Wox.Core/Plugin/PluginConfig.cs b/Wox.Core/Plugin/PluginConfig.cs index 008d889248..28cfecb969 100644 --- a/Wox.Core/Plugin/PluginConfig.cs +++ b/Wox.Core/Plugin/PluginConfig.cs @@ -25,10 +25,9 @@ namespace Wox.Core.Plugin public static List Parse(List pluginDirectories) { pluginMetadatas.Clear(); - ParseSystemPlugins(); foreach (string pluginDirectory in pluginDirectories) { - ParseUserPlugins(pluginDirectory); + ParsePluginConfigs(pluginDirectory); } if (PluginManager.DebuggerMode != null) @@ -39,31 +38,7 @@ namespace Wox.Core.Plugin return pluginMetadatas; } - private static void ParseSystemPlugins() - { - string systemPluginPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), - "Wox.Plugin.SystemPlugins.dll"); - if (!File.Exists(systemPluginPath)) - { - throw new WoxCritialException("System Plugin DLL is missing."); - } - - pluginMetadatas.Add(new PluginMetadata() - { - Name = "System Plugins", - Author = "System", - Description = "system plugins collection", - Website = "http://www.getwox.com", - Language = AllowedLanguage.CSharp, - Version = "1.0.0", - PluginType = PluginType.System, - ActionKeyword = "*", - ExecuteFileName = "Wox.Plugin.SystemPlugins.dll", - PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) - }); - } - - private static void ParseUserPlugins(string pluginDirectory) + private static void ParsePluginConfigs(string pluginDirectory) { if (!Directory.Exists(pluginDirectory)) return; diff --git a/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs b/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs index a20aa8ebf7..b02d2d13d0 100644 --- a/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs +++ b/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs @@ -3,13 +3,13 @@ using System.Linq; using System.Threading; using Wox.Infrastructure.Storage.UserSettings; using Wox.Plugin; -using Wox.Plugin.SystemPlugins; +//using Wox.Plugin.SystemPlugins; namespace Wox.Core.Plugin.QueryDispatcher { public class SystemPluginQueryDispatcher : IQueryDispatcher { - private IEnumerable allSytemPlugins = PluginManager.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System); + private IEnumerable allSytemPlugins = PluginManager.AllPlugins.Where(o => o.Metadata.ActionKeyword == "*"); public void Dispatch(Query query) { diff --git a/Wox.Core/Plugin/README.md b/Wox.Core/Plugin/README.md new file mode 100644 index 0000000000..c464179c54 --- /dev/null +++ b/Wox.Core/Plugin/README.md @@ -0,0 +1,5 @@ +There are two kinds of plugins: +1. System plugin + Those plugins that action keyword is "*", those plugin doesn't need action keyword +2. User Plugin + Those plugins that contains customized action keyword \ No newline at end of file diff --git a/Wox.Core/Theme/ITheme.cs b/Wox.Core/Theme/ITheme.cs new file mode 100644 index 0000000000..55bfccb21d --- /dev/null +++ b/Wox.Core/Theme/ITheme.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wox.Core.Theme +{ + interface ITheme + { + void ChangeTheme(string themeName); + List LoadAvailableThemes(); + } +} diff --git a/Wox.Core/Theme/Theme.cs b/Wox.Core/Theme/Theme.cs new file mode 100644 index 0000000000..c10f1a4526 --- /dev/null +++ b/Wox.Core/Theme/Theme.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using Wox.Core.UI; +using Wox.Infrastructure.Logger; +using Wox.Infrastructure.Storage.UserSettings; + +namespace Wox.Core.Theme +{ + public class Theme : IUIResource,ITheme + { + private static List themeDirectories = new List(); + + static Theme() + { + themeDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Themes")); + + string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE"); + if (userProfilePath != null) + { + themeDirectories.Add(Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Themes")); + } + + MakesureThemeDirectoriesExist(); + } + + private static void MakesureThemeDirectoriesExist() + { + foreach (string pluginDirectory in themeDirectories) + { + if (!Directory.Exists(pluginDirectory)) + { + try + { + Directory.CreateDirectory(pluginDirectory); + } + catch (System.Exception e) + { + Log.Error(e.Message); + } + } + } + } + + public void ChangeTheme(string themeName) + { + string themePath = GetThemePath(themeName); + if (string.IsNullOrEmpty(themePath)) + { + themePath = GetThemePath("Dark"); + if (string.IsNullOrEmpty(themePath)) + { + throw new System.Exception("Change theme failed"); + } + } + + UserSettingStorage.Instance.Theme = themeName; + UserSettingStorage.Instance.Save(); + + ResourceMerger.ApplyResources(); + } + + public ResourceDictionary GetResourceDictionary() + { + var dict = new ResourceDictionary + { + Source = new Uri(GetThemePath(UserSettingStorage.Instance.Theme), UriKind.Absolute) + }; + + Style queryBoxStyle = dict["QueryBoxStyle"] as Style; + if (queryBoxStyle != null) + { + queryBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, new FontFamily(UserSettingStorage.Instance.QueryBoxFont))); + queryBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(UserSettingStorage.Instance.QueryBoxFontStyle))); + queryBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(UserSettingStorage.Instance.QueryBoxFontWeight))); + queryBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(UserSettingStorage.Instance.QueryBoxFontStretch))); + } + + Style resultItemStyle = dict["ItemTitleStyle"] as Style; + Style resultSubItemStyle = dict["ItemSubTitleStyle"] as Style; + Style resultItemSelectedStyle = dict["ItemTitleSelectedStyle"] as Style; + Style resultSubItemSelectedStyle = dict["ItemSubTitleSelectedStyle"] as Style; + if (resultItemStyle != null && resultSubItemStyle != null && resultSubItemSelectedStyle != null && resultItemSelectedStyle != null) + { + Setter fontFamily = new Setter(TextBlock.FontFamilyProperty, new FontFamily(UserSettingStorage.Instance.ResultItemFont)); + Setter fontStyle = new Setter(TextBlock.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(UserSettingStorage.Instance.ResultItemFontStyle)); + Setter fontWeight = new Setter(TextBlock.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(UserSettingStorage.Instance.ResultItemFontWeight)); + Setter fontStretch = new Setter(TextBlock.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(UserSettingStorage.Instance.ResultItemFontStretch)); + + Setter[] setters = new Setter[] { fontFamily, fontStyle, fontWeight, fontStretch }; + Array.ForEach(new Style[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p))); + } + + return dict; + } + + public List LoadAvailableThemes() + { + List themes = new List(); + foreach (var themeDirectory in themeDirectories) + { + themes.AddRange( + Directory.GetFiles(themeDirectory) + .Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Base.xaml")) + .ToList()); + } + return themes; + } + + private string GetThemePath(string themeName) + { + foreach (string themeDirectory in themeDirectories) + { + string path = Path.Combine(themeDirectory, themeName + ".xaml"); + if (File.Exists(path)) + { + return path; + } + } + + return string.Empty; + } + } +} diff --git a/Wox.Core/Theme/ThemeManager.cs b/Wox.Core/Theme/ThemeManager.cs index baf59c37aa..a5dc1a2f9f 100644 --- a/Wox.Core/Theme/ThemeManager.cs +++ b/Wox.Core/Theme/ThemeManager.cs @@ -1,26 +1,16 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Reflection; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; -using Wox.Core.UI; -using Wox.Infrastructure.Logger; -using Wox.Infrastructure.Storage.UserSettings; +using System.Text; namespace Wox.Core.Theme { - public class ThemeManager : IUIResource + public class ThemeManager { - private static List themeDirectories = new List(); - private static ThemeManager instance; + private static Theme instance; private static object syncObject = new object(); - private ThemeManager() { } - - public static ThemeManager Instance + public static Theme Theme { get { @@ -30,122 +20,12 @@ namespace Wox.Core.Theme { if (instance == null) { - instance = new ThemeManager(); + instance = new Theme(); } } } return instance; } } - - static ThemeManager() - { - themeDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Themes")); - - string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE"); - if (userProfilePath != null) - { - themeDirectories.Add(Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Themes")); - } - - MakesureThemeDirectoriesExist(); - } - - private static void MakesureThemeDirectoriesExist() - { - foreach (string pluginDirectory in themeDirectories) - { - if (!Directory.Exists(pluginDirectory)) - { - try - { - Directory.CreateDirectory(pluginDirectory); - } - catch (System.Exception e) - { - Log.Error(e.Message); - } - } - } - } - - public void ChangeTheme(string themeName) - { - string themePath = GetThemePath(themeName); - if (string.IsNullOrEmpty(themePath)) - { - themePath = GetThemePath("Dark"); - if (string.IsNullOrEmpty(themePath)) - { - throw new System.Exception("Change theme failed"); - } - } - - UserSettingStorage.Instance.Theme = themeName; - UserSettingStorage.Instance.Save(); - - ResourceMerger.ApplyResources(); - } - - public ResourceDictionary GetResourceDictionary() - { - var dict = new ResourceDictionary - { - Source = new Uri(GetThemePath(UserSettingStorage.Instance.Theme), UriKind.Absolute) - }; - - Style queryBoxStyle = dict["QueryBoxStyle"] as Style; - if (queryBoxStyle != null) - { - queryBoxStyle.Setters.Add(new Setter(TextBox.FontFamilyProperty, new FontFamily(UserSettingStorage.Instance.QueryBoxFont))); - queryBoxStyle.Setters.Add(new Setter(TextBox.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(UserSettingStorage.Instance.QueryBoxFontStyle))); - queryBoxStyle.Setters.Add(new Setter(TextBox.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(UserSettingStorage.Instance.QueryBoxFontWeight))); - queryBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(UserSettingStorage.Instance.QueryBoxFontStretch))); - } - - Style resultItemStyle = dict["ItemTitleStyle"] as Style; - Style resultSubItemStyle = dict["ItemSubTitleStyle"] as Style; - Style resultItemSelectedStyle = dict["ItemTitleSelectedStyle"] as Style; - Style resultSubItemSelectedStyle = dict["ItemSubTitleSelectedStyle"] as Style; - if (resultItemStyle != null && resultSubItemStyle != null && resultSubItemSelectedStyle != null && resultItemSelectedStyle != null) - { - Setter fontFamily = new Setter(TextBlock.FontFamilyProperty, new FontFamily(UserSettingStorage.Instance.ResultItemFont)); - Setter fontStyle = new Setter(TextBlock.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(UserSettingStorage.Instance.ResultItemFontStyle)); - Setter fontWeight = new Setter(TextBlock.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(UserSettingStorage.Instance.ResultItemFontWeight)); - Setter fontStretch = new Setter(TextBlock.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(UserSettingStorage.Instance.ResultItemFontStretch)); - - Setter[] setters = new Setter[] { fontFamily, fontStyle, fontWeight, fontStretch }; - Array.ForEach(new Style[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p))); - } - - return dict; - } - - public List LoadAvailableThemes() - { - List themes = new List(); - foreach (var themeDirectory in themeDirectories) - { - themes.AddRange( - Directory.GetFiles(themeDirectory) - .Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Base.xaml")) - .ToList()); - } - return themes; - } - - private string GetThemePath(string themeName) - { - foreach (string themeDirectory in themeDirectories) - { - string path = Path.Combine(themeDirectory, themeName + ".xaml"); - if (File.Exists(path)) - { - return path; - } - } - - return string.Empty; - } } } diff --git a/Wox.Core/UI/IUIResource.cs b/Wox.Core/UI/IUIResource.cs new file mode 100644 index 0000000000..b4940ee39b --- /dev/null +++ b/Wox.Core/UI/IUIResource.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; + +namespace Wox.Core.UI +{ + /// + /// Object implement this interface will have the ability to has its own UI styles + /// + interface IUIResource + { + ResourceDictionary GetResourceDictionary(); + } +} diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index 61037d42b8..e9160ad1ca 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -56,8 +56,15 @@ + + + + + + + @@ -75,9 +82,10 @@ - + + @@ -85,10 +93,6 @@ {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} Wox.Infrastructure - - {69ce0206-cb41-453d-88af-df86092ef9b8} - Wox.Plugin.SystemPlugins - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} Wox.Plugin diff --git a/Wox.Core/i18n/AvailableLanguages.cs b/Wox.Core/i18n/AvailableLanguages.cs new file mode 100644 index 0000000000..ebf7de1b4d --- /dev/null +++ b/Wox.Core/i18n/AvailableLanguages.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wox.Core.i18n +{ + internal static class AvailableLanguages + { + public static Language English = new Language("en", "English"); + public static Language Chinese = new Language("zh-cn", "中文"); + public static Language Chinese_TW = new Language("zh-tw", "中文(繁体)"); + + public static List GetAvailableLanguages() + { + List languages = new List + { + English, + Chinese, + Chinese_TW + }; + return languages; + } + } +} \ No newline at end of file diff --git a/Wox.Core/i18n/IInternationalization.cs b/Wox.Core/i18n/IInternationalization.cs new file mode 100644 index 0000000000..cbf43364c4 --- /dev/null +++ b/Wox.Core/i18n/IInternationalization.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wox.Core.i18n +{ + interface IInternationalization + { + List LoadAvailableLanguages(); + + string GetTranslation(string key); + + void ChangeLanguage(Language language); + + void ChangeLanguage(string languageCode); + } +} diff --git a/Wox.Core/i18n/Internationalization.cs b/Wox.Core/i18n/Internationalization.cs new file mode 100644 index 0000000000..b61a65bcaf --- /dev/null +++ b/Wox.Core/i18n/Internationalization.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Windows; +using Wox.Core.Exception; +using Wox.Core.UI; +using Wox.Infrastructure.Logger; +using Wox.Infrastructure.Storage.UserSettings; + +namespace Wox.Core.i18n +{ + public class Internationalization : IInternationalization, IUIResource + { + private static List languageDirectories = new List(); + + static Internationalization() + { + languageDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages")); + MakesureThemeDirectoriesExist(); + } + + private static void MakesureThemeDirectoriesExist() + { + foreach (string pluginDirectory in languageDirectories) + { + if (!Directory.Exists(pluginDirectory)) + { + try + { + Directory.CreateDirectory(pluginDirectory); + } + catch (System.Exception e) + { + Log.Error(e.Message); + } + } + } + } + + public void ChangeLanguage(string languageCode) + { + Language language = GetLanguageByLanguageCode(languageCode); + ChangeLanguage(language); + } + + private Language GetLanguageByLanguageCode(string languageCode) + { + Language language = AvailableLanguages.GetAvailableLanguages().FirstOrDefault(o => o.LanguageCode.ToLower() == languageCode.ToLower()); + if (language == null) + { + throw new WoxI18nException("Invalid language code:" + languageCode); + } + + return language; + } + + public void ChangeLanguage(Language language) + { + if(language == null) throw new WoxI18nException("language can't be null"); + + string path = GetLanguagePath(language); + if (string.IsNullOrEmpty(path)) + { + path = GetLanguagePath(AvailableLanguages.English); + if (string.IsNullOrEmpty(path)) + { + throw new System.Exception("Change Language failed"); + } + } + + UserSettingStorage.Instance.Language = language.LanguageCode; + UserSettingStorage.Instance.Save(); + ResourceMerger.ApplyResources(); + } + + public ResourceDictionary GetResourceDictionary() + { + return new ResourceDictionary + { + Source = new Uri(GetLanguagePath(UserSettingStorage.Instance.Language), UriKind.Absolute) + }; + } + + public List LoadAvailableLanguages() + { + return AvailableLanguages.GetAvailableLanguages(); + } + + public string GetTranslation(string key) + { + try + { + object translation = Application.Current.FindResource(key); + if (translation == null) + { + return "NoTranslation"; + } + return translation.ToString(); + } + catch + { + return "NoTranslation"; + } + + } + + private string GetLanguagePath(string languageCode) + { + Language language = GetLanguageByLanguageCode(languageCode); + return GetLanguagePath(language); + } + + private string GetLanguagePath(Language language) + { + foreach (string directory in languageDirectories) + { + string path = Path.Combine(directory, language.LanguageCode + ".xaml"); + if (File.Exists(path)) + { + return path; + } + } + + return string.Empty; + } + } +} diff --git a/Wox.Core/i18n/InternationalizationManager.cs b/Wox.Core/i18n/InternationalizationManager.cs index 6750ab32d9..55ef73add4 100644 --- a/Wox.Core/i18n/InternationalizationManager.cs +++ b/Wox.Core/i18n/InternationalizationManager.cs @@ -10,15 +10,12 @@ using Wox.Infrastructure.Storage.UserSettings; namespace Wox.Core.i18n { - public class InternationalizationManager : IUIResource + public static class InternationalizationManager { - private static List languageDirectories = new List(); - private static InternationalizationManager instance; + private static Internationalization instance; private static object syncObject = new object(); - private InternationalizationManager() { } - - public static InternationalizationManager Instance + public static Internationalization Internationalization { get { @@ -28,114 +25,12 @@ namespace Wox.Core.i18n { if (instance == null) { - instance = new InternationalizationManager(); + instance = new Internationalization(); } } } return instance; } } - - static InternationalizationManager() - { - languageDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages")); - - string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE"); - if (userProfilePath != null) - { - languageDirectories.Add(Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Languages")); - } - - MakesureThemeDirectoriesExist(); - } - - private static void MakesureThemeDirectoriesExist() - { - foreach (string pluginDirectory in languageDirectories) - { - if (!Directory.Exists(pluginDirectory)) - { - try - { - Directory.CreateDirectory(pluginDirectory); - } - catch (System.Exception e) - { - Log.Error(e.Message); - } - } - } - } - - public void ChangeLanguage(string name) - { - string path = GetLanguagePath(name); - if (string.IsNullOrEmpty(path)) - { - path = GetLanguagePath("English"); - if (string.IsNullOrEmpty(path)) - { - throw new System.Exception("Change Language failed"); - } - } - - UserSettingStorage.Instance.Language = name; - UserSettingStorage.Instance.Save(); - ResourceMerger.ApplyResources(); - } - - public ResourceDictionary GetResourceDictionary() - { - return new ResourceDictionary - { - Source = new Uri(GetLanguagePath(UserSettingStorage.Instance.Language), UriKind.Absolute) - }; - } - - public List LoadAvailableLanguages() - { - List themes = new List(); - foreach (var directory in languageDirectories) - { - themes.AddRange( - Directory.GetFiles(directory) - .Where(filePath => filePath.EndsWith(".xaml")) - .Select(Path.GetFileNameWithoutExtension) - .ToList()); - } - return themes; - } - - public string GetTranslation(string key) - { - try - { - object translation = Application.Current.FindResource(key); - if (translation == null) - { - return "NoTranslation"; - } - return translation.ToString(); - } - catch - { - return "NoTranslation"; - } - - } - - private string GetLanguagePath(string name) - { - foreach (string directory in languageDirectories) - { - string path = Path.Combine(directory, name + ".xaml"); - if (File.Exists(path)) - { - return path; - } - } - - return string.Empty; - } } } \ No newline at end of file diff --git a/Wox.Core/i18n/Language.cs b/Wox.Core/i18n/Language.cs new file mode 100644 index 0000000000..5b9213149a --- /dev/null +++ b/Wox.Core/i18n/Language.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Wox.Core.i18n +{ + public class Language + { + public Language(string code, string display) + { + LanguageCode = code; + Display = display; + } + + /// + /// E.g. En or Zh-CN + /// + public string LanguageCode { get; set; } + + public string Display { get; set; } + } +} diff --git a/Wox.Infrastructure/ISingleton.cs b/Wox.Infrastructure/ISingleton.cs deleted file mode 100644 index 32555980f6..0000000000 --- a/Wox.Infrastructure/ISingleton.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Wox.Infrastructure -{ - interface ISingleton - { - T Instance { get; } - } -} diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index ed897bbd58..d862f7774a 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -57,7 +57,6 @@ - diff --git a/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs b/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs deleted file mode 100644 index eea1194798..0000000000 --- a/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Wox.Infrastructure.Storage.UserSettings; - -namespace Wox.Plugin.SystemPlugins -{ - - public abstract class BaseSystemPlugin : ISystemPlugin - { - public string PluginDirectory { get; set; } - - public abstract string ID { get; } - public virtual string Name { get { return "System workflow"; } } - public virtual string Description { get { return "System workflow"; } } - public virtual string IcoPath { get { return null; } } - - public string FullIcoPath - { - get - { - if (string.IsNullOrEmpty(IcoPath)) return string.Empty; - if (IcoPath.StartsWith("data:")) - { - return IcoPath; - } - - return Path.Combine(PluginDirectory, IcoPath); - } - } - - protected abstract List QueryInternal(Query query); - - protected abstract void InitInternal(PluginInitContext context); - - public List Query(Query query) - { - if (string.IsNullOrEmpty(query.RawQuery)) return new List(); - var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == ID); - if (customizedPluginConfig != null && customizedPluginConfig.Disabled) - { - return new List(); - } - return QueryInternal(query); - } - - public void Init(PluginInitContext context) - { - InitInternal(context); - } - } -} \ No newline at end of file diff --git a/Wox.Plugin.SystemPlugins/ISystemPlugin.cs b/Wox.Plugin.SystemPlugins/ISystemPlugin.cs deleted file mode 100644 index de73c5b60e..0000000000 --- a/Wox.Plugin.SystemPlugins/ISystemPlugin.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Wox.Plugin.SystemPlugins -{ - public interface ISystemPlugin : IPlugin - { - string ID { get; } - string Name { get; } - string Description { get; } - } -} diff --git a/Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs b/Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs deleted file mode 100644 index 4f471fc902..0000000000 --- a/Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Wox.Plugin.SystemPlugins")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.SystemPlugins")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bab8d3dc-d6be-42b3-8aa4-24801d667528")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml.cs b/Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml.cs deleted file mode 100644 index c9c478b04f..0000000000 --- a/Wox.Plugin.SystemPlugins/Sys/SysSettings.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Wox.Plugin.SystemPlugins.Sys { - /// - /// Interaction logic for SysSettings.xaml - /// - public partial class SysSettings : UserControl { - public SysSettings(List Results) { - InitializeComponent(); - - foreach (var Result in Results) { - this.lbxCommands.Items.Add(Result); - } - } - } -} diff --git a/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj b/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj deleted file mode 100644 index 75604f9377..0000000000 --- a/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Debug - AnyCPU - {69CE0206-CB41-453D-88AF-DF86092EF9B8} - Library - Properties - Wox.Plugin.SystemPlugins - Wox.Plugin.SystemPlugins - v3.5 - 512 - ..\ - true - - - true - full - false - ..\Output\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\Output\Release\ - TRACE - prompt - 4 - - - - ..\packages\ini-parser.2.0.2\lib\INIFileParser.dll - - - False - ..\packages\log4net.2.0.3\lib\net35-full\log4net.dll - - - False - ..\packages\Newtonsoft.Json.6.0.5\lib\net35\Newtonsoft.Json.dll - - - - - - ..\packages\YAMP.1.3.0\lib\net35\YAMP.dll - - - - - - - - - - - - - CMDSetting.xaml - - - - - - - - FolderPluginSettings.xaml - - - - - - ProgramSetting.xaml - - - - - - - - - - ProgramSuffixes.xaml - - - - - - SysSettings.xaml - - - - WebSearchesSetting.xaml - - - - - - - - - - - - - WebSearchSetting.xaml - - - - - {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3} - Wox.Infrastructure - - - {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} - Wox.Plugin - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - - - - - - - - - - - \ No newline at end of file diff --git a/Wox.Plugin.SystemPlugins/packages.config b/Wox.Plugin.SystemPlugins/packages.config deleted file mode 100644 index 5ada4eb8a9..0000000000 --- a/Wox.Plugin.SystemPlugins/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Wox.Test/UrlPluginTest.cs b/Wox.Test/UrlPluginTest.cs index d94c00c18d..79f95109a2 100644 --- a/Wox.Test/UrlPluginTest.cs +++ b/Wox.Test/UrlPluginTest.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; using NUnit.Framework; -using Wox.Plugin.SystemPlugins; +using Wox.Plugin.Url; namespace Wox.Test { diff --git a/Wox.Test/Wox.Test.csproj b/Wox.Test/Wox.Test.csproj index 95b03e737d..e6f189a012 100644 --- a/Wox.Test/Wox.Test.csproj +++ b/Wox.Test/Wox.Test.csproj @@ -56,6 +56,10 @@ + + {A3DCCBCA-ACC1-421D-B16E-210896234C26} + Wox.Plugin.Url + {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2} Wox.Core @@ -64,10 +68,6 @@ {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3} Wox.Infrastructure - - {69CE0206-CB41-453D-88AF-DF86092EF9B8} - Wox.Plugin.SystemPlugins - {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} Wox.Plugin diff --git a/Wox.sln b/Wox.sln index 3886f50076..0f85b0b76b 100644 --- a/Wox.sln +++ b/Wox.sln @@ -11,14 +11,32 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugin", "Plugin", "{3A73F5 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.SystemPlugins", "Wox.Plugin.SystemPlugins\Wox.Plugin.SystemPlugins.csproj", "{69CE0206-CB41-453D-88AF-DF86092EF9B8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Infrastructure", "Wox.Infrastructure\Wox.Infrastructure.csproj", "{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.PluginManagement", "Plugins\Wox.Plugin.PluginManagement\Wox.Plugin.PluginManagement.csproj", "{049490F0-ECD2-4148-9B39-2135EC346EBE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Core", "Wox.Core\Wox.Core.csproj", "{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Program", "Plugins\Wox.Plugin.Program\Wox.Plugin.Program.csproj", "{FDB3555B-58EF-4AE6-B5F1-904719637AB4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.CMD", "Plugins\Wox.Plugin.CMD\Wox.Plugin.CMD.csproj", "{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.WebSearch", "Plugins\Wox.Plugin.WebSearch\Wox.Plugin.WebSearch.csproj", "{403B57F2-1856-4FC7-8A24-36AB346B763E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.ControlPanel", "Plugins\Wox.Plugin.ControlPanel\Wox.Plugin.ControlPanel.csproj", "{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Folder", "Plugins\Wox.Plugin.Folder\Wox.Plugin.Folder.csproj", "{787B8AA6-CA93-4C84-96FE-DF31110AD1C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.PluginIndicator", "Plugins\Wox.Plugin.PluginIndicator\Wox.Plugin.PluginIndicator.csproj", "{FDED22C8-B637-42E8-824A-63B5B6E05A3A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Caculator", "Plugins\Wox.Plugin.Caculator\Wox.Plugin.Caculator.csproj", "{59BD9891-3837-438A-958D-ADC7F91F6F7E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Sys", "Plugins\Wox.Plugin.Sys\Wox.Plugin.Sys.csproj", "{0B9DE348-9361-4940-ADB6-F5953BFFCCEC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Url", "Plugins\Wox.Plugin.Url\Wox.Plugin.Url.csproj", "{A3DCCBCA-ACC1-421D-B16E-210896234C26}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Color", "Plugins\Wox.Plugin.Color\Wox.Plugin.Color.csproj", "{F35190AA-4758-4D9E-A193-E3BDF6AD3567}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,10 +55,6 @@ Global {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU {DB90F671-D861-46BB-93A3-F1304F5BA1C5}.Release|Any CPU.Build.0 = Release|Any CPU - {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Release|Any CPU.Build.0 = Release|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -53,11 +67,61 @@ Global {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}.Debug|Any CPU.Build.0 = Debug|Any CPU {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}.Release|Any CPU.ActiveCfg = Release|Any CPU {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB3555B-58EF-4AE6-B5F1-904719637AB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB3555B-58EF-4AE6-B5F1-904719637AB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB3555B-58EF-4AE6-B5F1-904719637AB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB3555B-58EF-4AE6-B5F1-904719637AB4}.Release|Any CPU.Build.0 = Release|Any CPU + {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}.Release|Any CPU.Build.0 = Release|Any CPU + {403B57F2-1856-4FC7-8A24-36AB346B763E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {403B57F2-1856-4FC7-8A24-36AB346B763E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|Any CPU.Build.0 = Release|Any CPU + {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.Build.0 = Release|Any CPU + {787B8AA6-CA93-4C84-96FE-DF31110AD1C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {787B8AA6-CA93-4C84-96FE-DF31110AD1C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {787B8AA6-CA93-4C84-96FE-DF31110AD1C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {787B8AA6-CA93-4C84-96FE-DF31110AD1C4}.Release|Any CPU.Build.0 = Release|Any CPU + {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Release|Any CPU.Build.0 = Release|Any CPU + {59BD9891-3837-438A-958D-ADC7F91F6F7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59BD9891-3837-438A-958D-ADC7F91F6F7E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59BD9891-3837-438A-958D-ADC7F91F6F7E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59BD9891-3837-438A-958D-ADC7F91F6F7E}.Release|Any CPU.Build.0 = Release|Any CPU + {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}.Release|Any CPU.Build.0 = Release|Any CPU + {A3DCCBCA-ACC1-421D-B16E-210896234C26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3DCCBCA-ACC1-421D-B16E-210896234C26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3DCCBCA-ACC1-421D-B16E-210896234C26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3DCCBCA-ACC1-421D-B16E-210896234C26}.Release|Any CPU.Build.0 = Release|Any CPU + {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F35190AA-4758-4D9E-A193-E3BDF6AD3567}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {049490F0-ECD2-4148-9B39-2135EC346EBE} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {403B57F2-1856-4FC7-8A24-36AB346B763E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {787B8AA6-CA93-4C84-96FE-DF31110AD1C4} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {59BD9891-3837-438A-958D-ADC7F91F6F7E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {F35190AA-4758-4D9E-A193-E3BDF6AD3567} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} EndGlobalSection EndGlobal diff --git a/Wox/ActionKeyword.xaml.cs b/Wox/ActionKeyword.xaml.cs index 23f2952bb4..08a7a6a622 100644 --- a/Wox/ActionKeyword.xaml.cs +++ b/Wox/ActionKeyword.xaml.cs @@ -29,7 +29,7 @@ namespace Wox PluginPair plugin = PluginManager.GetPlugin(pluginId); if (plugin == null) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("cannotFindSpecifiedPlugin")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("cannotFindSpecifiedPlugin")); Close(); return; } @@ -52,14 +52,14 @@ namespace Wox { if (string.IsNullOrEmpty(tbAction.Text)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordCannotBeEmpty")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("newActionKeywordCannotBeEmpty")); return; } //check new action keyword didn't used by other plugin if (PluginManager.AllPlugins.Exists(o => o.Metadata.ActionKeyword == tbAction.Text.Trim())) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordHasBeenAssigned")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("newActionKeywordHasBeenAssigned")); return; } @@ -81,7 +81,7 @@ namespace Wox customizedPluginConfig.Actionword = tbAction.Text.Trim(); } UserSettingStorage.Instance.Save(); - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("succeed")); Close(); } } diff --git a/Wox/App.xaml b/Wox/App.xaml index 3021178455..c2b08e8574 100644 --- a/Wox/App.xaml +++ b/Wox/App.xaml @@ -6,7 +6,7 @@ - + diff --git a/Wox/CustomQueryHotkeySetting.xaml.cs b/Wox/CustomQueryHotkeySetting.xaml.cs index 9c5b4a8a0c..29abfa707c 100644 --- a/Wox/CustomQueryHotkeySetting.xaml.cs +++ b/Wox/CustomQueryHotkeySetting.xaml.cs @@ -29,7 +29,7 @@ namespace Wox { if (!ctlHotkey.CurrentHotkeyAvailable) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("hotkeyIsNotUnavailable")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("hotkeyIsNotUnavailable")); return; } @@ -49,13 +49,13 @@ namespace Wox settingWidow.MainWindow.ChangeQuery(pluginHotkey.ActionKeyword); settingWidow.MainWindow.ShowApp(); }); - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("succeed")); } else { if (updateCustomHotkey.Hotkey != ctlHotkey.CurrentHotkey.ToString() && !ctlHotkey.CurrentHotkeyAvailable) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("hotkeyIsNotUnavailable")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("hotkeyIsNotUnavailable")); return; } var oldHotkey = updateCustomHotkey.Hotkey; @@ -68,7 +68,7 @@ namespace Wox settingWidow.MainWindow.ShowApp(); settingWidow.MainWindow.ChangeQuery(updateCustomHotkey.ActionKeyword); }); - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("succeed")); } UserSettingStorage.Instance.Save(); @@ -81,7 +81,7 @@ namespace Wox updateCustomHotkey = UserSettingStorage.Instance.CustomPluginHotkeys.FirstOrDefault(o => o.ActionKeyword == item.ActionKeyword && o.Hotkey == item.Hotkey); if (updateCustomHotkey == null) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPluginHotkey")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidPluginHotkey")); Close(); return; } @@ -89,7 +89,7 @@ namespace Wox tbAction.Text = updateCustomHotkey.ActionKeyword; ctlHotkey.SetHotkey(updateCustomHotkey.Hotkey, false); update = true; - lblAdd.Text = InternationalizationManager.Instance.GetTranslation("update"); + lblAdd.Text = InternationalizationManager.Internationalization.GetTranslation("update"); } private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e) diff --git a/Wox/HotkeyControl.xaml.cs b/Wox/HotkeyControl.xaml.cs index 77cd95ea3b..e1650d197b 100644 --- a/Wox/HotkeyControl.xaml.cs +++ b/Wox/HotkeyControl.xaml.cs @@ -99,12 +99,12 @@ namespace Wox if (!CurrentHotkeyAvailable) { tbMsg.Foreground = new SolidColorBrush(Colors.Red); - tbMsg.Text = InternationalizationManager.Instance.GetTranslation("hotkeyUnavailable"); + tbMsg.Text = InternationalizationManager.Internationalization.GetTranslation("hotkeyUnavailable"); } else { tbMsg.Foreground = new SolidColorBrush(Colors.Green); - tbMsg.Text = InternationalizationManager.Instance.GetTranslation("succeed"); + tbMsg.Text = InternationalizationManager.Internationalization.GetTranslation("succeed"); } OnOnHotkeyChanged(); } diff --git a/Wox/Languages/English.xaml b/Wox/Languages/en.xaml similarity index 100% rename from Wox/Languages/English.xaml rename to Wox/Languages/en.xaml diff --git a/Wox/Languages/中文.xaml b/Wox/Languages/zh-cn.xaml similarity index 100% rename from Wox/Languages/中文.xaml rename to Wox/Languages/zh-cn.xaml diff --git a/Wox/Languages/zh-tw.xaml b/Wox/Languages/zh-tw.xaml new file mode 100644 index 0000000000..5f10da7471 --- /dev/null +++ b/Wox/Languages/zh-tw.xaml @@ -0,0 +1,85 @@ + + + 註冊熱鍵:{0} 失敗 + 啟動命令 {0} 失敗 + 不是合法的Wox插件格式 + + + + 通用 + 開機啟動 + 失去焦點時自動隱藏Wox + 不顯示新版本提示 + 語言 + + + 插件 + 瀏覽更多插件 + 禁用 + 觸發關鍵字 + 插件目錄 + 作者 + + + 主題 + 瀏覽更多主題 + 你好,Wox + 查詢框字體 + 結果項字體 + 窗口模式 + 透明度 + + + 熱鍵 + Wox激活熱鍵 + 自定義查詢熱鍵 + 刪除 + 編輯 + 增加 + 請選擇一項 + 你確定要刪除插件 {0} 的熱鍵嗎? + + + 代理 + 啟用代理 + 服務器 + 端口 + 用戶名 + 密碼 + 測試代理 + 保存 + 服務器不能為空 + 端口不能為空 + 非法的端口格式 + 保存代理設置成功 + 代理設置正確 + 代理連接失敗 + + + 關於 + 網站 + 版本 + + + + 舊觸發關鍵字 + 新觸發關鍵字 + 取消 + 確定 + 找不到指定的插件 + 新觸發關鍵字不能為空 + 新觸發關鍵字已經被指派給其他插件了,請重新選擇一個關鍵字 + 成功 + + + 預覽 + 熱鍵不可用,請選擇一個新的熱鍵 + 插件熱鍵不合法 + 更新 + + + 熱鍵不可用 + + \ No newline at end of file diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 9feba7a30c..64795886e4 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -175,8 +175,8 @@ namespace Wox pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent; ThreadPool.SetMaxThreads(30, 10); - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); - InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); + InternationalizationManager.Internationalization.ChangeLanguage(UserSettingStorage.Instance.Language); SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey); SetCustomPluginHotkey(); @@ -268,7 +268,7 @@ namespace Wox } catch (Exception) { - string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr); + string errorMsg = string.Format(InternationalizationManager.Internationalization.GetTranslation("registerHotkeyFailed"), hotkeyStr); MessageBox.Show(errorMsg); } } @@ -686,7 +686,7 @@ namespace Wox } catch (Exception ex) { - string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("couldnotStartCmd"), cmd); + string errorMsg = string.Format(InternationalizationManager.Internationalization.GetTranslation("couldnotStartCmd"), cmd); ShowMsg(errorMsg, ex.Message, null); } return false; @@ -704,7 +704,7 @@ namespace Wox } else { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidWoxPluginFileFormat")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidWoxPluginFileFormat")); } } } diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index 966416430d..b1a2543b9b 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -4,7 +4,6 @@ xmlns:wox="clr-namespace:Wox" xmlns:UserSettings="clr-namespace:Wox.Infrastructure.Storage.UserSettings;assembly=Wox.Infrastructure" x:Class="Wox.SettingWindow" xmlns:woxPlugin="clr-namespace:Wox.Plugin;assembly=Wox.Plugin" - xmlns:system="clr-namespace:Wox.Plugin.SystemPlugins;assembly=Wox.Plugin.SystemPlugins" xmlns:converters="clr-namespace:Wox.Converters" Icon="Images\app.png" Title="Wox Settings" @@ -47,24 +46,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 8445f2c098..d9c61732eb 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -15,7 +15,6 @@ using Wox.Core.Plugin; using Wox.Infrastructure.Storage.UserSettings; using Wox.Plugin; using Wox.Helper; -using Wox.Plugin.SystemPlugins; using Wox.Update; using Application = System.Windows.Forms.Application; using File = System.IO.File; @@ -152,7 +151,7 @@ namespace Wox } }); - foreach (string theme in ThemeManager.Instance.LoadAvailableThemes()) + foreach (string theme in ThemeManager.Theme.LoadAvailableThemes()) { string themeName = System.IO.Path.GetFileNameWithoutExtension(theme); themeComboBox.Items.Add(themeName); @@ -176,7 +175,7 @@ namespace Wox } //PreviewPanel - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); #endregion #region Plugin @@ -189,16 +188,7 @@ namespace Wox { new CollectionContainer { - Collection = - PluginManager.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System) - .Select(o => o.Plugin) - .Cast() - }, - FindResource("FeatureBoxSeperator"), - new CollectionContainer - { - Collection = - PluginManager.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.User) + Collection = PluginManager.AllPlugins } }; lbPlugins.ItemsSource = plugins; @@ -246,15 +236,16 @@ namespace Wox private void LoadLanguages() { - cbLanguages.ItemsSource = InternationalizationManager.Instance.LoadAvailableLanguages(); + cbLanguages.ItemsSource = InternationalizationManager.Internationalization.LoadAvailableLanguages(); + cbLanguages.DisplayMemberPath = "Display"; + cbLanguages.SelectedValuePath = "LanguageCode"; cbLanguages.SelectedValue = UserSettingStorage.Instance.Language; cbLanguages.SelectionChanged += cbLanguages_SelectionChanged; } void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e) { - string language = cbLanguages.SelectedValue.ToString(); - InternationalizationManager.Instance.ChangeLanguage(language); + InternationalizationManager.Internationalization.ChangeLanguage(cbLanguages.SelectedItem as Language); } private void EnableProxy() @@ -332,12 +323,12 @@ namespace Wox CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey; if (item == null) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("pleaseSelectAnItem")); return; } - string deleteWarning = string.Format(InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey); - if (MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes) + string deleteWarning = string.Format(InternationalizationManager.Internationalization.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey); + if (MessageBox.Show(deleteWarning, InternationalizationManager.Internationalization.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes) { UserSettingStorage.Instance.CustomPluginHotkeys.Remove(item); lvCustomHotkey.Items.Refresh(); @@ -357,7 +348,7 @@ namespace Wox } else { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("pleaseSelectAnItem")); } } @@ -377,7 +368,7 @@ namespace Wox private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { string themeName = themeComboBox.SelectedItem.ToString(); - ThemeManager.Instance.ChangeTheme(themeName); + ThemeManager.Theme.ChangeTheme(themeName); UserSettingStorage.Instance.Theme = themeName; UserSettingStorage.Instance.Save(); } @@ -390,7 +381,7 @@ namespace Wox this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface(); UserSettingStorage.Instance.Save(); - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e) @@ -410,7 +401,7 @@ namespace Wox UserSettingStorage.Instance.QueryBoxFontWeight = typeface.Weight.ToString(); UserSettingStorage.Instance.QueryBoxFontStyle = typeface.Style.ToString(); UserSettingStorage.Instance.Save(); - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } } @@ -422,7 +413,7 @@ namespace Wox this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface(); UserSettingStorage.Instance.Save(); - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e) @@ -440,7 +431,7 @@ namespace Wox UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString(); UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString(); UserSettingStorage.Instance.Save(); - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } } @@ -453,7 +444,7 @@ namespace Wox else PreviewMainPanel.Opacity = 1; - ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); Dispatcher.DelayInvoke("delaySaveUserSetting", o => { UserSettingStorage.Instance.Save(); @@ -500,19 +491,6 @@ namespace Wox { //system plugin provider = lbPlugins.SelectedItem as ISettingProvider; - var sys = lbPlugins.SelectedItem as BaseSystemPlugin; - if (sys != null) - { - pluginTitle.Text = sys.Name; - pluginId = sys.ID; - pluginSubTitle.Text = sys.Description; - pluginAuthor.Visibility = Visibility.Collapsed; - pluginActionKeyword.Visibility = Visibility.Collapsed; - tbOpenPluginDirecoty.Visibility = Visibility.Collapsed; - pluginActionKeywordTitle.Visibility = Visibility.Collapsed; - pluginTitle.Cursor = Cursors.Arrow; - pluginIcon.Source = ImageLoader.ImageLoader.Load(sys.FullIcoPath); - } } var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == pluginId); @@ -549,16 +527,6 @@ namespace Wox id = pair.Metadata.ID; name = pair.Metadata.Name; } - else - { - //system plugin - var sys = lbPlugins.SelectedItem as BaseSystemPlugin; - if (sys != null) - { - id = sys.ID; - name = sys.Name; - } - } var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == id); if (customizedPluginConfig == null) { @@ -655,17 +623,17 @@ namespace Wox { if (string.IsNullOrEmpty(tbProxyServer.Text)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("serverCantBeEmpty")); return; } if (string.IsNullOrEmpty(tbProxyPort.Text)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("portCantBeEmpty")); return; } if (!int.TryParse(tbProxyPort.Text, out port)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidPortFormat")); return; } } @@ -676,25 +644,25 @@ namespace Wox UserSettingStorage.Instance.ProxyPassword = tbProxyPassword.Password; UserSettingStorage.Instance.Save(); - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("saveProxySuccessfully")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("saveProxySuccessfully")); } private void btnTestProxy_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(tbProxyServer.Text)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("serverCantBeEmpty")); return; } if (string.IsNullOrEmpty(tbProxyPort.Text)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("portCantBeEmpty")); return; } int port; if (!int.TryParse(tbProxyPort.Text, out port)) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidPortFormat")); return; } @@ -715,16 +683,16 @@ namespace Wox HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode == HttpStatusCode.OK) { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyIsCorrect")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("proxyIsCorrect")); } else { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("proxyConnectFailed")); } } catch { - MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed")); + MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("proxyConnectFailed")); } } diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 4a595ff105..036549499b 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -113,6 +113,11 @@ + + + + + @@ -135,7 +140,6 @@ - @@ -147,7 +151,6 @@ - CustomQueryHotkeySetting.xaml @@ -156,7 +159,6 @@ HotkeyControl.xaml - Msg.xaml @@ -167,8 +169,6 @@ SettingWindow.xaml - - Designer MSBuild:Compile @@ -185,16 +185,21 @@ Designer MSBuild:Compile - + MSBuild:Compile Designer PreserveNewest - + Designer MSBuild:Compile PreserveNewest + + MSBuild:Compile + Designer + PreserveNewest + MSBuild:Compile Designer @@ -286,10 +291,6 @@ {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} Wox.Infrastructure - - {69ce0206-cb41-453d-88af-df86092ef9b8} - Wox.Plugin.SystemPlugins - {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} Wox.Plugin @@ -317,30 +318,6 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - @@ -363,27 +340,6 @@ - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - PreserveNewest @@ -393,15 +349,6 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest -