mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
Rename Wox.Plugin.System to Wox.Plugin.SystemPlugins
Finish moving ProgramSetting into featureBox
This commit is contained in:
@@ -8,7 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugin", "Plugin", "{3A73F5
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}"
|
||||||
EndProject
|
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
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public abstract class BaseSystemPlugin :ISystemPlugin
|
public abstract class BaseSystemPlugin :ISystemPlugin
|
||||||
{
|
{
|
||||||
@@ -10,7 +10,7 @@ using System.Windows.Forms;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public class BrowserBookmarks : BaseSystemPlugin
|
public class BrowserBookmarks : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -5,7 +5,7 @@ using System.Linq;
|
|||||||
using System.Runtime.Serialization.Formatters.Binary;
|
using System.Runtime.Serialization.Formatters.Binary;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.CMD
|
namespace Wox.Plugin.SystemPlugins.CMD
|
||||||
{
|
{
|
||||||
public class CMD : BaseSystemPlugin
|
public class CMD : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Wox.Infrastructure.Storage;
|
using Wox.Infrastructure.Storage;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.CMD
|
namespace Wox.Plugin.SystemPlugins.CMD
|
||||||
{
|
{
|
||||||
public class CMDStorage : BaseStorage<CMDStorage>
|
public class CMDStorage : BaseStorage<CMDStorage>
|
||||||
{
|
{
|
||||||
@@ -8,7 +8,7 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using YAMP;
|
using YAMP;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public class Calculator : BaseSystemPlugin
|
public class Calculator : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -7,7 +7,7 @@ using System.Text;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public class DirectoryIndicator : BaseSystemPlugin
|
public class DirectoryIndicator : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public interface IProgramSource
|
public interface IProgramSource
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public interface ISystemPlugin : IPlugin
|
public interface ISystemPlugin : IPlugin
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<UserControl x:Class="Wox.Plugin.System.ProgramSetting"
|
<UserControl x:Class="Wox.Plugin.SystemPlugins.ProgramSetting"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@@ -13,7 +13,7 @@ using System.Windows.Navigation;
|
|||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for ProgramSetting.xaml
|
/// Interaction logic for ProgramSetting.xaml
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<Window x:Class="Wox.Plugin.System.ProgramSourceSetting"
|
<Window x:Class="Wox.Plugin.SystemPlugins.ProgramSourceSetting"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
Icon="Images\app.png"
|
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Title="ProgramSourceSetting" Height="350" Width="674.766">
|
Title="ProgramSourceSetting" Height="350" Width="674.766">
|
||||||
@@ -17,7 +17,7 @@ using Wox.Infrastructure.Storage;
|
|||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
using MessageBox = System.Windows.MessageBox;
|
using MessageBox = System.Windows.MessageBox;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public partial class ProgramSourceSetting : Window
|
public partial class ProgramSourceSetting : Window
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ namespace Wox.Plugin.System
|
|||||||
this.settingWindow = settingWidow;
|
this.settingWindow = settingWidow;
|
||||||
InitializeComponent();
|
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)
|
public void UpdateItem(ProgramSource programSource)
|
||||||
@@ -115,7 +115,7 @@ namespace Wox.Plugin.System
|
|||||||
{
|
{
|
||||||
string item = cbType.SelectedItem as String;
|
string item = cbType.SelectedItem as String;
|
||||||
Type type;
|
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);
|
var attrs = type.GetCustomAttributes(typeof(BrowsableAttribute), false);
|
||||||
if (attrs.Length > 0 && (attrs[0] as BrowsableAttribute).Browsable == false)
|
if (attrs.Length > 0 && (attrs[0] as BrowsableAttribute).Browsable == false)
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.ProgramSources
|
namespace Wox.Plugin.SystemPlugins.ProgramSources
|
||||||
{
|
{
|
||||||
[global::System.ComponentModel.Browsable(false)]
|
[global::System.ComponentModel.Browsable(false)]
|
||||||
public class AppPathsProgramSource: AbstractProgramSource
|
public class AppPathsProgramSource: AbstractProgramSource
|
||||||
@@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.ProgramSources
|
namespace Wox.Plugin.SystemPlugins.ProgramSources
|
||||||
{
|
{
|
||||||
[global::System.ComponentModel.Browsable(false)]
|
[global::System.ComponentModel.Browsable(false)]
|
||||||
public class CommonStartMenuProgramSource : FileSystemProgramSource
|
public class CommonStartMenuProgramSource : FileSystemProgramSource
|
||||||
@@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.ProgramSources
|
namespace Wox.Plugin.SystemPlugins.ProgramSources
|
||||||
{
|
{
|
||||||
public class FileSystemProgramSource : AbstractProgramSource
|
public class FileSystemProgramSource : AbstractProgramSource
|
||||||
{
|
{
|
||||||
@@ -6,7 +6,7 @@ using System.IO;
|
|||||||
using IniParser;
|
using IniParser;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.ProgramSources
|
namespace Wox.Plugin.SystemPlugins.ProgramSources
|
||||||
{
|
{
|
||||||
public class PortableAppsProgramSource : AbstractProgramSource
|
public class PortableAppsProgramSource : AbstractProgramSource
|
||||||
{
|
{
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.ProgramSources
|
namespace Wox.Plugin.SystemPlugins.ProgramSources
|
||||||
{
|
{
|
||||||
[global::System.ComponentModel.Browsable(false)]
|
[global::System.ComponentModel.Browsable(false)]
|
||||||
public class UserStartMenuProgramSource : FileSystemProgramSource
|
public class UserStartMenuProgramSource : FileSystemProgramSource
|
||||||
@@ -11,9 +11,9 @@ using Microsoft.Win32;
|
|||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
using Wox.Infrastructure.Storage;
|
using Wox.Infrastructure.Storage;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
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
|
public class Program
|
||||||
{
|
{
|
||||||
@@ -43,7 +43,7 @@ namespace Wox.Plugin.System
|
|||||||
public IProgramSource Source { get; set; }
|
public IProgramSource Source { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Programs : BaseSystemPlugin
|
public class Programs : BaseSystemPlugin, ISettingProvider
|
||||||
{
|
{
|
||||||
List<Program> installedList = new List<Program>();
|
List<Program> installedList = new List<Program>();
|
||||||
List<IProgramSource> sources = new List<IProgramSource>();
|
List<IProgramSource> sources = new List<IProgramSource>();
|
||||||
@@ -161,5 +161,14 @@ namespace Wox.Plugin.System
|
|||||||
{
|
{
|
||||||
get { return base.Description; }
|
get { return base.Description; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region ISettingProvider Members
|
||||||
|
|
||||||
|
public System.Windows.Controls.Control CreateSettingPanel()
|
||||||
|
{
|
||||||
|
return new ProgramSetting();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
|
|||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("Wox.Plugin.System")]
|
[assembly: AssemblyTitle("Wox.Plugin.SystemPlugins")]
|
||||||
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
|
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("Wox.Plugin.System")]
|
[assembly: AssemblyProduct("Wox.Plugin.SystemPlugins")]
|
||||||
[assembly: AssemblyCopyright("The MIT License (MIT)")]
|
[assembly: AssemblyCopyright("The MIT License (MIT)")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
@@ -10,7 +10,7 @@ using Newtonsoft.Json.Serialization;
|
|||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
using YAMP.Numerics;
|
using YAMP.Numerics;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.SuggestionSources
|
namespace Wox.Plugin.SystemPlugins.SuggestionSources
|
||||||
{
|
{
|
||||||
public class Google : AbstractSuggestionSource
|
public class Google : AbstractSuggestionSource
|
||||||
{
|
{
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Wox.Plugin.System.SuggestionSources
|
namespace Wox.Plugin.SystemPlugins.SuggestionSources
|
||||||
{
|
{
|
||||||
public interface ISuggestionSource
|
public interface ISuggestionSource
|
||||||
{
|
{
|
||||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public class Sys : BaseSystemPlugin
|
public class Sys : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -6,7 +6,7 @@ using Wox.Infrastructure;
|
|||||||
using Wox.Infrastructure.Storage;
|
using Wox.Infrastructure.Storage;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.System
|
namespace Wox.Plugin.SystemPlugins
|
||||||
{
|
{
|
||||||
public class ThirdpartyPluginIndicator : BaseSystemPlugin
|
public class ThirdpartyPluginIndicator : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -7,9 +7,9 @@ using Newtonsoft.Json;
|
|||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
using Wox.Infrastructure.Storage;
|
using Wox.Infrastructure.Storage;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
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
|
public class WebSearchPlugin : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
<ProjectGuid>{69CE0206-CB41-453D-88AF-DF86092EF9B8}</ProjectGuid>
|
<ProjectGuid>{69CE0206-CB41-453D-88AF-DF86092EF9B8}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Wox.Plugin.System</RootNamespace>
|
<RootNamespace>Wox.Plugin.SystemPlugins</RootNamespace>
|
||||||
<AssemblyName>Wox.Plugin.System</AssemblyName>
|
<AssemblyName>Wox.Plugin.SystemPlugins</AssemblyName>
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||||
13
Wox.Plugin/ISettingProvider.cs
Normal file
13
Wox.Plugin/ISettingProvider.cs
Normal file
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,16 +31,22 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="WindowsFormsIntegration" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AllowedLanguage.cs" />
|
<Compile Include="AllowedLanguage.cs" />
|
||||||
<Compile Include="IPlugin.cs" />
|
<Compile Include="IPlugin.cs" />
|
||||||
|
<Compile Include="ISettingProvider.cs" />
|
||||||
<Compile Include="PluginPair.cs" />
|
<Compile Include="PluginPair.cs" />
|
||||||
<Compile Include="PluginInitContext.cs" />
|
<Compile Include="PluginInitContext.cs" />
|
||||||
<Compile Include="PluginMetadata.cs" />
|
<Compile Include="PluginMetadata.cs" />
|
||||||
|
|||||||
2
Wox.sln
2
Wox.sln
@@ -11,7 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugin", "Plugin", "{3A73F5
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}"
|
||||||
EndProject
|
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
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Windows.Forms;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Wox.Helper;
|
using Wox.Helper;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
using Wox.Plugin.System;
|
using Wox.Plugin.SystemPlugins;
|
||||||
|
|
||||||
namespace Wox.PluginLoader
|
namespace Wox.PluginLoader
|
||||||
{
|
{
|
||||||
@@ -41,7 +41,7 @@ namespace Wox.PluginLoader
|
|||||||
metadata.Version = "1.0";
|
metadata.Version = "1.0";
|
||||||
metadata.PluginType = PluginType.System;
|
metadata.PluginType = PluginType.System;
|
||||||
metadata.ActionKeyword = "*";
|
metadata.ActionKeyword = "*";
|
||||||
metadata.ExecuteFileName = "Wox.Plugin.System.dll";
|
metadata.ExecuteFileName = "Wox.Plugin.SystemPlugins.dll";
|
||||||
metadata.PluginDirecotry = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
|
metadata.PluginDirecotry = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
|
||||||
pluginMetadatas.Add(metadata);
|
pluginMetadatas.Add(metadata);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Reflection;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Wox.Helper;
|
using Wox.Helper;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
using Wox.Plugin.System;
|
using Wox.Plugin.SystemPlugins;
|
||||||
|
|
||||||
namespace Wox.PluginLoader
|
namespace Wox.PluginLoader
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:wox="clr-namespace:Wox"
|
xmlns:wox="clr-namespace:Wox"
|
||||||
xmlns:UserSettings="clr-namespace:Wox.Infrastructure.Storage.UserSettings;assembly=Wox.Infrastructure" x:Class="Wox.SettingWindow"
|
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: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"
|
Icon="Images\app.png"
|
||||||
Title="Wox Setting"
|
Title="Wox Setting"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
<TabItem Header="Features">
|
<TabItem Header="Features">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="250"/>
|
<ColumnDefinition Width="200"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<ListBox x:Name="featureBox" Grid.Column="0" Margin="0" SelectionChanged="featureBox_OnSelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="True" >
|
<ListBox x:Name="featureBox" Grid.Column="0" Margin="0" SelectionChanged="featureBox_OnSelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="True" >
|
||||||
@@ -280,16 +280,30 @@
|
|||||||
</ListBox>
|
</ListBox>
|
||||||
<Grid Margin="0" Grid.Column="1">
|
<Grid Margin="0" Grid.Column="1">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="80"/>
|
<RowDefinition Height="58"/>
|
||||||
<RowDefinition />
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
<ContentControl x:Name="PluginInfoPanel" Grid.ColumnSpan="1" Grid.Row="0" Margin="10 10 10 0">
|
||||||
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="48"></ColumnDefinition>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Width="48" Height="48" HorizontalAlignment="Left" x:Name="pluginIcon"/>
|
||||||
|
<Grid Margin="10,0,0,0" Grid.Column="1" HorizontalAlignment="Stretch">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
<RowDefinition Height="Auto"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock VerticalAlignment="Center" x:Name="pluginTitle" ToolTip="{Binding Source=pluginTitle, Path=Text}" FontSize="24"></TextBlock>
|
||||||
|
<TextBlock Grid.Row="1" x:Name="pluginSubTitle" Opacity="0.5" ToolTip="{Binding Source=pluginSubTitle, Path=Text}" Visibility="{Binding Source=pluginSubTitle, Path=Text, Converter={wox:StringNullOrEmptyToVisibilityConverter}}" ></TextBlock>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</ContentControl>
|
||||||
|
|
||||||
|
<ContentControl x:Name="PluginContentPanel" Grid.ColumnSpan="1" Grid.Row="1" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
|
|
||||||
<StackPanel Grid.Row="0" Grid.Column="0" Margin="10" Orientation="Vertical">
|
</ContentControl>
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<StackPanel x:Name="PluginContentPanel" Grid.ColumnSpan="1" Grid.Row="1" Margin="0">
|
|
||||||
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Wox.Infrastructure.Storage;
|
|||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
using Wox.Helper;
|
using Wox.Helper;
|
||||||
|
using Wox.Plugin.SystemPlugins;
|
||||||
using Application = System.Windows.Forms.Application;
|
using Application = System.Windows.Forms.Application;
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
using MessageBox = System.Windows.MessageBox;
|
using MessageBox = System.Windows.MessageBox;
|
||||||
@@ -25,6 +26,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
string woxLinkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "wox.lnk");
|
string woxLinkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "wox.lnk");
|
||||||
public MainWindow MainWindow;
|
public MainWindow MainWindow;
|
||||||
|
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
||||||
|
|
||||||
public SettingWindow()
|
public SettingWindow()
|
||||||
{
|
{
|
||||||
@@ -164,7 +166,7 @@ namespace Wox
|
|||||||
Collection =
|
Collection =
|
||||||
PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System)
|
PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System)
|
||||||
.Select(o => o.Plugin)
|
.Select(o => o.Plugin)
|
||||||
.Cast<Wox.Plugin.System.ISystemPlugin>()
|
.Cast<Wox.Plugin.SystemPlugins.ISystemPlugin>()
|
||||||
},
|
},
|
||||||
FindResource("FeatureBoxSeperator"),
|
FindResource("FeatureBoxSeperator"),
|
||||||
new CollectionContainer()
|
new CollectionContainer()
|
||||||
@@ -453,6 +455,54 @@ namespace Wox
|
|||||||
|
|
||||||
private void featureBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
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();
|
// throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,9 +266,9 @@
|
|||||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||||
<Name>Wox.Infrastructure</Name>
|
<Name>Wox.Infrastructure</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Wox.Plugin.System\Wox.Plugin.System.csproj">
|
<ProjectReference Include="..\Wox.Plugin.SystemPlugins\Wox.Plugin.SystemPlugins.csproj">
|
||||||
<Project>{69ce0206-cb41-453d-88af-df86092ef9b8}</Project>
|
<Project>{69ce0206-cb41-453d-88af-df86092ef9b8}</Project>
|
||||||
<Name>Wox.Plugin.System</Name>
|
<Name>Wox.Plugin.SystemPlugins</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Wox.Plugin\Wox.Plugin.csproj">
|
<ProjectReference Include="..\Wox.Plugin\Wox.Plugin.csproj">
|
||||||
<Project>{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}</Project>
|
<Project>{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user