diff --git a/Wox.2010.sln b/Wox.2010.sln index 8ebf8032a9..4eeedf50f1 100644 --- a/Wox.2010.sln +++ b/Wox.2010.sln @@ -8,7 +8,7 @@ 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.System", "Wox.Plugin.System\Wox.Plugin.System.csproj", "{69CE0206-CB41-453D-88AF-DF86092EF9B8}" +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}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}" EndProject diff --git a/Wox.Plugin.System/BaseSystemPlugin.cs b/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs similarity index 96% rename from Wox.Plugin.System/BaseSystemPlugin.cs rename to Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs index 710ccf509a..46fd476479 100644 --- a/Wox.Plugin.System/BaseSystemPlugin.cs +++ b/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public abstract class BaseSystemPlugin :ISystemPlugin { diff --git a/Wox.Plugin.System/BrowserBookmarks.cs b/Wox.Plugin.SystemPlugins/BrowserBookmarks.cs similarity index 99% rename from Wox.Plugin.System/BrowserBookmarks.cs rename to Wox.Plugin.SystemPlugins/BrowserBookmarks.cs index 73fc40826c..5e3e0ce95c 100644 --- a/Wox.Plugin.System/BrowserBookmarks.cs +++ b/Wox.Plugin.SystemPlugins/BrowserBookmarks.cs @@ -10,7 +10,7 @@ using System.Windows.Forms; using Newtonsoft.Json; using Wox.Infrastructure; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class BrowserBookmarks : BaseSystemPlugin { diff --git a/Wox.Plugin.System/CMD/CMD.cs b/Wox.Plugin.SystemPlugins/CMD/CMD.cs similarity index 99% rename from Wox.Plugin.System/CMD/CMD.cs rename to Wox.Plugin.SystemPlugins/CMD/CMD.cs index 9fee1a1a5b..2ef85e90d3 100644 --- a/Wox.Plugin.System/CMD/CMD.cs +++ b/Wox.Plugin.SystemPlugins/CMD/CMD.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms; -namespace Wox.Plugin.System.CMD +namespace Wox.Plugin.SystemPlugins.CMD { public class CMD : BaseSystemPlugin { diff --git a/Wox.Plugin.System/CMD/CMDStorage.cs b/Wox.Plugin.SystemPlugins/CMD/CMDStorage.cs similarity index 94% rename from Wox.Plugin.System/CMD/CMDStorage.cs rename to Wox.Plugin.SystemPlugins/CMD/CMDStorage.cs index 10ccde0eb2..d762027554 100644 --- a/Wox.Plugin.System/CMD/CMDStorage.cs +++ b/Wox.Plugin.SystemPlugins/CMD/CMDStorage.cs @@ -5,7 +5,7 @@ using System.Text; using Newtonsoft.Json; using Wox.Infrastructure.Storage; -namespace Wox.Plugin.System.CMD +namespace Wox.Plugin.SystemPlugins.CMD { public class CMDStorage : BaseStorage { diff --git a/Wox.Plugin.System/Calculator.cs b/Wox.Plugin.SystemPlugins/Calculator.cs similarity index 98% rename from Wox.Plugin.System/Calculator.cs rename to Wox.Plugin.SystemPlugins/Calculator.cs index 48f6a553e0..9453851dd5 100644 --- a/Wox.Plugin.System/Calculator.cs +++ b/Wox.Plugin.SystemPlugins/Calculator.cs @@ -8,7 +8,7 @@ using System.Text.RegularExpressions; using System.Windows.Forms; using YAMP; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class Calculator : BaseSystemPlugin { diff --git a/Wox.Plugin.System/DirectoryIndicator.cs b/Wox.Plugin.SystemPlugins/DirectoryIndicator.cs similarity index 99% rename from Wox.Plugin.System/DirectoryIndicator.cs rename to Wox.Plugin.SystemPlugins/DirectoryIndicator.cs index c59d9bd2ae..80372bf675 100644 --- a/Wox.Plugin.System/DirectoryIndicator.cs +++ b/Wox.Plugin.SystemPlugins/DirectoryIndicator.cs @@ -7,7 +7,7 @@ using System.Text; using System.Windows.Forms; using Wox.Infrastructure; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class DirectoryIndicator : BaseSystemPlugin { diff --git a/Wox.Plugin.System/IProgramSource.cs b/Wox.Plugin.SystemPlugins/IProgramSource.cs similarity index 97% rename from Wox.Plugin.System/IProgramSource.cs rename to Wox.Plugin.SystemPlugins/IProgramSource.cs index 4373bdf66d..239c482bec 100644 --- a/Wox.Plugin.System/IProgramSource.cs +++ b/Wox.Plugin.SystemPlugins/IProgramSource.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Diagnostics; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public interface IProgramSource { diff --git a/Wox.Plugin.System/ISystemPlugin.cs b/Wox.Plugin.SystemPlugins/ISystemPlugin.cs similarity index 86% rename from Wox.Plugin.System/ISystemPlugin.cs rename to Wox.Plugin.SystemPlugins/ISystemPlugin.cs index eae75d34d9..cd61777402 100644 --- a/Wox.Plugin.System/ISystemPlugin.cs +++ b/Wox.Plugin.SystemPlugins/ISystemPlugin.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public interface ISystemPlugin : IPlugin { diff --git a/Wox.Plugin.System/ProgramSetting.xaml b/Wox.Plugin.SystemPlugins/ProgramSetting.xaml similarity index 97% rename from Wox.Plugin.System/ProgramSetting.xaml rename to Wox.Plugin.SystemPlugins/ProgramSetting.xaml index ffb082efa3..468ab5953a 100644 --- a/Wox.Plugin.System/ProgramSetting.xaml +++ b/Wox.Plugin.SystemPlugins/ProgramSetting.xaml @@ -1,4 +1,4 @@ - /// Interaction logic for ProgramSetting.xaml diff --git a/Wox.Plugin.System/ProgramSourceSetting.xaml b/Wox.Plugin.SystemPlugins/ProgramSourceSetting.xaml similarity index 96% rename from Wox.Plugin.System/ProgramSourceSetting.xaml rename to Wox.Plugin.SystemPlugins/ProgramSourceSetting.xaml index 3d41c837ac..a3a3da77a6 100644 --- a/Wox.Plugin.System/ProgramSourceSetting.xaml +++ b/Wox.Plugin.SystemPlugins/ProgramSourceSetting.xaml @@ -1,7 +1,6 @@ - diff --git a/Wox.Plugin.System/ProgramSourceSetting.xaml.cs b/Wox.Plugin.SystemPlugins/ProgramSourceSetting.xaml.cs similarity index 94% rename from Wox.Plugin.System/ProgramSourceSetting.xaml.cs rename to Wox.Plugin.SystemPlugins/ProgramSourceSetting.xaml.cs index 70914f81db..c629fe406f 100644 --- a/Wox.Plugin.System/ProgramSourceSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/ProgramSourceSetting.xaml.cs @@ -17,7 +17,7 @@ using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; using MessageBox = System.Windows.MessageBox; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public partial class ProgramSourceSetting : Window { @@ -30,7 +30,7 @@ namespace Wox.Plugin.System this.settingWindow = settingWidow; InitializeComponent(); - this.cbType.ItemsSource = Wox.Plugin.System.Programs.SourceTypes.Select(o => o.Key).ToList(); + this.cbType.ItemsSource = Wox.Plugin.SystemPlugins.Programs.SourceTypes.Select(o => o.Key).ToList(); } public void UpdateItem(ProgramSource programSource) @@ -115,7 +115,7 @@ namespace Wox.Plugin.System { string item = cbType.SelectedItem as String; Type type; - if (item != null && Wox.Plugin.System.Programs.SourceTypes.TryGetValue(item, out type)) + if (item != null && Wox.Plugin.SystemPlugins.Programs.SourceTypes.TryGetValue(item, out type)) { var attrs = type.GetCustomAttributes(typeof(BrowsableAttribute), false); if (attrs.Length > 0 && (attrs[0] as BrowsableAttribute).Browsable == false) diff --git a/Wox.Plugin.System/ProgramSources/AppPathsProgramSource.cs b/Wox.Plugin.SystemPlugins/ProgramSources/AppPathsProgramSource.cs similarity index 97% rename from Wox.Plugin.System/ProgramSources/AppPathsProgramSource.cs rename to Wox.Plugin.SystemPlugins/ProgramSources/AppPathsProgramSource.cs index d3436f1ac1..a55cf13364 100644 --- a/Wox.Plugin.System/ProgramSources/AppPathsProgramSource.cs +++ b/Wox.Plugin.SystemPlugins/ProgramSources/AppPathsProgramSource.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.System.ProgramSources +namespace Wox.Plugin.SystemPlugins.ProgramSources { [global::System.ComponentModel.Browsable(false)] public class AppPathsProgramSource: AbstractProgramSource diff --git a/Wox.Plugin.System/ProgramSources/CommonStartMenuProgramSource.cs b/Wox.Plugin.SystemPlugins/ProgramSources/CommonStartMenuProgramSource.cs similarity index 96% rename from Wox.Plugin.System/ProgramSources/CommonStartMenuProgramSource.cs rename to Wox.Plugin.SystemPlugins/ProgramSources/CommonStartMenuProgramSource.cs index d23a7ebda4..a49720325d 100644 --- a/Wox.Plugin.System/ProgramSources/CommonStartMenuProgramSource.cs +++ b/Wox.Plugin.SystemPlugins/ProgramSources/CommonStartMenuProgramSource.cs @@ -5,7 +5,7 @@ using System.Text; using System.Runtime.InteropServices; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.System.ProgramSources +namespace Wox.Plugin.SystemPlugins.ProgramSources { [global::System.ComponentModel.Browsable(false)] public class CommonStartMenuProgramSource : FileSystemProgramSource diff --git a/Wox.Plugin.System/ProgramSources/FileSystemProgramSource.cs b/Wox.Plugin.SystemPlugins/ProgramSources/FileSystemProgramSource.cs similarity index 97% rename from Wox.Plugin.System/ProgramSources/FileSystemProgramSource.cs rename to Wox.Plugin.SystemPlugins/ProgramSources/FileSystemProgramSource.cs index 5792105683..67826f077b 100644 --- a/Wox.Plugin.System/ProgramSources/FileSystemProgramSource.cs +++ b/Wox.Plugin.SystemPlugins/ProgramSources/FileSystemProgramSource.cs @@ -5,7 +5,7 @@ using System.Text; using System.IO; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.System.ProgramSources +namespace Wox.Plugin.SystemPlugins.ProgramSources { public class FileSystemProgramSource : AbstractProgramSource { diff --git a/Wox.Plugin.System/ProgramSources/PortableAppsProgramSource.cs b/Wox.Plugin.SystemPlugins/ProgramSources/PortableAppsProgramSource.cs similarity index 99% rename from Wox.Plugin.System/ProgramSources/PortableAppsProgramSource.cs rename to Wox.Plugin.SystemPlugins/ProgramSources/PortableAppsProgramSource.cs index 62d198d8da..fb048400bb 100644 --- a/Wox.Plugin.System/ProgramSources/PortableAppsProgramSource.cs +++ b/Wox.Plugin.SystemPlugins/ProgramSources/PortableAppsProgramSource.cs @@ -6,7 +6,7 @@ using System.IO; using IniParser; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.System.ProgramSources +namespace Wox.Plugin.SystemPlugins.ProgramSources { public class PortableAppsProgramSource : AbstractProgramSource { diff --git a/Wox.Plugin.System/ProgramSources/UserStartMenuProgramSource.cs b/Wox.Plugin.SystemPlugins/ProgramSources/UserStartMenuProgramSource.cs similarity index 93% rename from Wox.Plugin.System/ProgramSources/UserStartMenuProgramSource.cs rename to Wox.Plugin.SystemPlugins/ProgramSources/UserStartMenuProgramSource.cs index 0536c9d7ad..df249b141b 100644 --- a/Wox.Plugin.System/ProgramSources/UserStartMenuProgramSource.cs +++ b/Wox.Plugin.SystemPlugins/ProgramSources/UserStartMenuProgramSource.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.System.ProgramSources +namespace Wox.Plugin.SystemPlugins.ProgramSources { [global::System.ComponentModel.Browsable(false)] public class UserStartMenuProgramSource : FileSystemProgramSource diff --git a/Wox.Plugin.System/Programs.cs b/Wox.Plugin.SystemPlugins/Programs.cs similarity index 94% rename from Wox.Plugin.System/Programs.cs rename to Wox.Plugin.SystemPlugins/Programs.cs index 3028a6311f..26a6348794 100644 --- a/Wox.Plugin.System/Programs.cs +++ b/Wox.Plugin.SystemPlugins/Programs.cs @@ -11,9 +11,9 @@ using Microsoft.Win32; using Wox.Infrastructure; using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; -using Wox.Plugin.System.ProgramSources; +using Wox.Plugin.SystemPlugins.ProgramSources; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class Program { @@ -43,7 +43,7 @@ namespace Wox.Plugin.System public IProgramSource Source { get; set; } } - public class Programs : BaseSystemPlugin + public class Programs : BaseSystemPlugin, ISettingProvider { List installedList = new List(); List sources = new List(); @@ -161,5 +161,14 @@ namespace Wox.Plugin.System { get { return base.Description; } } + + #region ISettingProvider Members + + public System.Windows.Controls.Control CreateSettingPanel() + { + return new ProgramSetting(); + } + + #endregion } } diff --git a/Wox.Plugin.System/Properties/AssemblyInfo.cs b/Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs similarity index 92% rename from Wox.Plugin.System/Properties/AssemblyInfo.cs rename to Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs index a6d4f187dc..4f471fc902 100644 --- a/Wox.Plugin.System/Properties/AssemblyInfo.cs +++ b/Wox.Plugin.SystemPlugins/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ 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.System")] +[assembly: AssemblyTitle("Wox.Plugin.SystemPlugins")] [assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.System")] +[assembly: AssemblyProduct("Wox.Plugin.SystemPlugins")] [assembly: AssemblyCopyright("The MIT License (MIT)")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Wox.Plugin.System/SuggestionSources/Google.cs b/Wox.Plugin.SystemPlugins/SuggestionSources/Google.cs similarity index 96% rename from Wox.Plugin.System/SuggestionSources/Google.cs rename to Wox.Plugin.SystemPlugins/SuggestionSources/Google.cs index aa52014191..7dde3cfa9d 100644 --- a/Wox.Plugin.System/SuggestionSources/Google.cs +++ b/Wox.Plugin.SystemPlugins/SuggestionSources/Google.cs @@ -10,7 +10,7 @@ using Newtonsoft.Json.Serialization; using Wox.Infrastructure; using YAMP.Numerics; -namespace Wox.Plugin.System.SuggestionSources +namespace Wox.Plugin.SystemPlugins.SuggestionSources { public class Google : AbstractSuggestionSource { diff --git a/Wox.Plugin.System/SuggestionSources/ISuggestionSource.cs b/Wox.Plugin.SystemPlugins/SuggestionSources/ISuggestionSource.cs similarity index 88% rename from Wox.Plugin.System/SuggestionSources/ISuggestionSource.cs rename to Wox.Plugin.SystemPlugins/SuggestionSources/ISuggestionSource.cs index 4683f3cab2..255ee40773 100644 --- a/Wox.Plugin.System/SuggestionSources/ISuggestionSource.cs +++ b/Wox.Plugin.SystemPlugins/SuggestionSources/ISuggestionSource.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; -namespace Wox.Plugin.System.SuggestionSources +namespace Wox.Plugin.SystemPlugins.SuggestionSources { public interface ISuggestionSource { diff --git a/Wox.Plugin.System/Sys.cs b/Wox.Plugin.SystemPlugins/Sys.cs similarity index 99% rename from Wox.Plugin.System/Sys.cs rename to Wox.Plugin.SystemPlugins/Sys.cs index 5bf3b0988b..9a9d28d805 100644 --- a/Wox.Plugin.System/Sys.cs +++ b/Wox.Plugin.SystemPlugins/Sys.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class Sys : BaseSystemPlugin { diff --git a/Wox.Plugin.System/ThirdpartyPluginIndicator.cs b/Wox.Plugin.SystemPlugins/ThirdpartyPluginIndicator.cs similarity index 98% rename from Wox.Plugin.System/ThirdpartyPluginIndicator.cs rename to Wox.Plugin.SystemPlugins/ThirdpartyPluginIndicator.cs index 6cf5fc6bfa..a81cd036d1 100644 --- a/Wox.Plugin.System/ThirdpartyPluginIndicator.cs +++ b/Wox.Plugin.SystemPlugins/ThirdpartyPluginIndicator.cs @@ -6,7 +6,7 @@ using Wox.Infrastructure; using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class ThirdpartyPluginIndicator : BaseSystemPlugin { diff --git a/Wox.Plugin.System/WebSearchPlugin.cs b/Wox.Plugin.SystemPlugins/WebSearchPlugin.cs similarity index 97% rename from Wox.Plugin.System/WebSearchPlugin.cs rename to Wox.Plugin.SystemPlugins/WebSearchPlugin.cs index 98441321f2..926ac2eca6 100644 --- a/Wox.Plugin.System/WebSearchPlugin.cs +++ b/Wox.Plugin.SystemPlugins/WebSearchPlugin.cs @@ -7,9 +7,9 @@ using Newtonsoft.Json; using Wox.Infrastructure; using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; -using Wox.Plugin.System.SuggestionSources; +using Wox.Plugin.SystemPlugins.SuggestionSources; -namespace Wox.Plugin.System +namespace Wox.Plugin.SystemPlugins { public class WebSearchPlugin : BaseSystemPlugin { diff --git a/Wox.Plugin.System/Wox.Plugin.System.csproj b/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj similarity index 97% rename from Wox.Plugin.System/Wox.Plugin.System.csproj rename to Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj index b2600d2b89..18699affd0 100644 --- a/Wox.Plugin.System/Wox.Plugin.System.csproj +++ b/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj @@ -7,8 +7,8 @@ {69CE0206-CB41-453D-88AF-DF86092EF9B8} Library Properties - Wox.Plugin.System - Wox.Plugin.System + Wox.Plugin.SystemPlugins + Wox.Plugin.SystemPlugins v3.5 512 ..\ diff --git a/Wox.Plugin.System/packages.config b/Wox.Plugin.SystemPlugins/packages.config similarity index 100% rename from Wox.Plugin.System/packages.config rename to Wox.Plugin.SystemPlugins/packages.config diff --git a/Wox.Plugin/ISettingProvider.cs b/Wox.Plugin/ISettingProvider.cs new file mode 100644 index 0000000000..b0542a2a1b --- /dev/null +++ b/Wox.Plugin/ISettingProvider.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Controls; + +namespace Wox.Plugin +{ + public interface ISettingProvider + { + Control CreateSettingPanel(); + } +} diff --git a/Wox.Plugin/Wox.Plugin.csproj b/Wox.Plugin/Wox.Plugin.csproj index 5f4b47f792..e6a31c09cc 100644 --- a/Wox.Plugin/Wox.Plugin.csproj +++ b/Wox.Plugin/Wox.Plugin.csproj @@ -31,16 +31,22 @@ 4 + + + + + + diff --git a/Wox.sln b/Wox.sln index 6367f1e6fa..10d0a2842e 100644 --- a/Wox.sln +++ b/Wox.sln @@ -11,7 +11,7 @@ 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.System", "Wox.Plugin.System\Wox.Plugin.System.csproj", "{69CE0206-CB41-453D-88AF-DF86092EF9B8}" +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}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}" EndProject diff --git a/Wox/PluginLoader/BasePluginLoader.cs b/Wox/PluginLoader/BasePluginLoader.cs index de6328815c..fdad604f44 100644 --- a/Wox/PluginLoader/BasePluginLoader.cs +++ b/Wox/PluginLoader/BasePluginLoader.cs @@ -7,7 +7,7 @@ using System.Windows.Forms; using Newtonsoft.Json; using Wox.Helper; using Wox.Plugin; -using Wox.Plugin.System; +using Wox.Plugin.SystemPlugins; namespace Wox.PluginLoader { @@ -41,7 +41,7 @@ namespace Wox.PluginLoader metadata.Version = "1.0"; metadata.PluginType = PluginType.System; metadata.ActionKeyword = "*"; - metadata.ExecuteFileName = "Wox.Plugin.System.dll"; + metadata.ExecuteFileName = "Wox.Plugin.SystemPlugins.dll"; metadata.PluginDirecotry = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath); pluginMetadatas.Add(metadata); } diff --git a/Wox/PluginLoader/CSharpPluginLoader.cs b/Wox/PluginLoader/CSharpPluginLoader.cs index d56d4cfd42..3f0faffe08 100644 --- a/Wox/PluginLoader/CSharpPluginLoader.cs +++ b/Wox/PluginLoader/CSharpPluginLoader.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Threading; using Wox.Helper; using Wox.Plugin; -using Wox.Plugin.System; +using Wox.Plugin.SystemPlugins; namespace Wox.PluginLoader { diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index d256edebd1..68ead94308 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -4,7 +4,7 @@ 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.System;assembly=Wox.Plugin.System" + xmlns:system="clr-namespace:Wox.Plugin.SystemPlugins;assembly=Wox.Plugin.SystemPlugins" Icon="Images\app.png" Title="Wox Setting" ResizeMode="NoResize" @@ -219,7 +219,7 @@ - + @@ -280,16 +280,30 @@ - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 97cf015c38..3a5411dc59 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -14,6 +14,7 @@ using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage.UserSettings; using Wox.Plugin; using Wox.Helper; +using Wox.Plugin.SystemPlugins; using Application = System.Windows.Forms.Application; using File = System.IO.File; using MessageBox = System.Windows.MessageBox; @@ -25,6 +26,7 @@ namespace Wox { string woxLinkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "wox.lnk"); public MainWindow MainWindow; + private Dictionary featureControls = new Dictionary(); public SettingWindow() { @@ -164,7 +166,7 @@ namespace Wox Collection = PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System) .Select(o => o.Plugin) - .Cast() + .Cast() }, FindResource("FeatureBoxSeperator"), new CollectionContainer() @@ -453,6 +455,54 @@ namespace Wox private void featureBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { + ISettingProvider provider = null; + var pair = featureBox.SelectedItem as PluginPair; + if (pair != null) + { + provider = pair.Plugin as ISettingProvider; + pluginTitle.Text = pair.Metadata.Name; + pluginSubTitle.Text = pair.Metadata.Description; + SyntaxSugars.CallOrRescueDefault( + () => + pluginIcon.Source = + (ImageSource) + new Wox.ImagePathConverter().Convert( + new object[] {pair.Metadata.IcoPath, pair.Metadata.PluginDirecotry}, null, null, + null)); + } + else + { + provider = featureBox.SelectedItem as ISettingProvider; + + var sys = featureBox.SelectedItem as BaseSystemPlugin; + if (sys != null) + { + pluginTitle.Text = sys.Name; + pluginSubTitle.Text = sys.Description; + SyntaxSugars.CallOrRescueDefault( + () => + pluginIcon.Source = + (ImageSource) + new Wox.ImagePathConverter().Convert( + new object[] { sys.IcoPath, sys.PluginDirectory }, null, null, + null)); + } + } + + this.PluginContentPanel.Content = null; + if (provider != null) + { + Control control = null; + if (!featureControls.TryGetValue(provider, out control)) + featureControls.Add(provider, control = provider.CreateSettingPanel()); + + PluginContentPanel.Content = control; + control.HorizontalAlignment = HorizontalAlignment.Stretch; + control.VerticalAlignment = VerticalAlignment.Stretch; + control.Width = Double.NaN; + control.Height = Double.NaN; + } + // featureControls // throw new NotImplementedException(); } } diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 4e41cee63c..ec447d19db 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -266,9 +266,9 @@ {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} Wox.Infrastructure - + {69ce0206-cb41-453d-88af-df86092ef9b8} - Wox.Plugin.System + Wox.Plugin.SystemPlugins {8451ECDD-2EA4-4966-BB0A-7BBC40138E80}