Refactoring. Move system plugins to seperate DLLs.
@ -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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
List<Result> results = new List<Result>();
|
||||
List<Result> pushedResults = new List<Result>();
|
||||
@ -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();
|
@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="Wox.Plugin.SystemPlugins.CMD.CMDSetting"
|
||||
<UserControl x:Class="Wox.Plugin.CMD.CMDSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
@ -1,19 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
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;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins.CMD
|
||||
namespace Wox.Plugin.CMD
|
||||
{
|
||||
public partial class CMDSetting : UserControl
|
||||
{
|
@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Wox.Infrastructure.Storage;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins.CMD
|
||||
namespace Wox.Plugin.CMD
|
||||
{
|
||||
public class CMDStorage : JsonStrorage<CMDStorage>
|
||||
{
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
36
Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
103
Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.CMD</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.CMD</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.CMD\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CMD.cs" />
|
||||
<Compile Include="CMDSetting.xaml.cs">
|
||||
<DependentUpon>CMDSetting.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CMDStorage.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="CMDSetting.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\cmd.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
5
Plugins/Wox.Plugin.CMD/packages.config
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.3" targetFramework="net35" />
|
||||
<package id="Newtonsoft.Json" version="6.0.7" targetFramework="net35" />
|
||||
</packages>
|
12
Plugins/Wox.Plugin.CMD/plugin.json
Normal file
@ -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"
|
||||
}
|
@ -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<Result> QueryInternal(Query query)
|
||||
public List<Result> 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)";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
36
Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
87
Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{59BD9891-3837-438A-958D-ADC7F91F6F7E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Caculator</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Caculator</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Caculator\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="YAMP">
|
||||
<HintPath>..\..\packages\YAMP.1.4.0\lib\net35\YAMP.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Calculator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\calculator.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
4
Plugins/Wox.Plugin.Caculator/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="YAMP" version="1.4.0" targetFramework="net35" />
|
||||
</packages>
|
12
Plugins/Wox.Plugin.Caculator/plugin.json
Normal file
@ -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"
|
||||
}
|
@ -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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
var raw = query.RawQuery;
|
||||
if (!IsAvailable(raw)) return new List<Result>(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)
|
||||
{
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
36
Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
70
Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F35190AA-4758-4D9E-A193-E3BDF6AD3567}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Color</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Color</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Color\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Color.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\color.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
12
Plugins/Wox.Plugin.Color/plugin.json
Normal file
@ -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"
|
||||
}
|
@ -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<ControlPanelItem> controlPanelItems = new List<ControlPanelItem>();
|
||||
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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
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
|
@ -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
|
@ -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
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
36
Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.ControlPanel</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.ControlPanel</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.ControlPanel\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ControlPanel.cs" />
|
||||
<Compile Include="ControlPanelItem.cs" />
|
||||
<Compile Include="ControlPanelList.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\ControlPanel.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
12
Plugins/Wox.Plugin.ControlPanel/plugin.json
Normal file
@ -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"
|
||||
}
|
@ -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<string> 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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
if(string.IsNullOrEmpty(query.RawQuery)) return new List<Result>();
|
||||
string input = query.RawQuery.ToLower();
|
||||
|
||||
List<FolderLink> userFolderLinks = UserSettingStorage.Instance.FolderLinks.Where(
|
@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="Wox.Plugin.SystemPlugins.Folder.FileSystemSettings"
|
||||
<UserControl x:Class="Wox.Plugin.Folder.FileSystemSettings"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
@ -1,10 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using UserControl = System.Windows.Controls.UserControl;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins.Folder {
|
||||
namespace Wox.Plugin.Folder {
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
36
Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
99
Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{787B8AA6-CA93-4C84-96FE-DF31110AD1C4}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Folder</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Folder</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Folder\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FolderPlugin.cs" />
|
||||
<Compile Include="FolderPluginSettings.xaml.cs">
|
||||
<DependentUpon>FolderPluginSettings.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="FolderPluginSettings.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\folder.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
4
Plugins/Wox.Plugin.Folder/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.3" targetFramework="net35" />
|
||||
</packages>
|
12
Plugins/Wox.Plugin.Folder/plugin.json
Normal file
@ -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"
|
||||
}
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@ -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<PluginPair> allPlugins = new List<PluginPair>();
|
||||
private PluginInitContext context;
|
||||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
List<Result> results = new List<Result>();
|
||||
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."; }
|
||||
}
|
||||
}
|
||||
}
|
@ -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")]
|
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{FDED22C8-B637-42E8-824A-63B5B6E05A3A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.PluginIndicator</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.PluginIndicator</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.PluginIndicator\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PluginIndicator.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\work.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
12
Plugins/Wox.Plugin.PluginIndicator/plugin.json
Normal file
@ -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"
|
||||
}
|
@ -62,9 +62,9 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\plugin.png">
|
||||
<None Include="Images\plugin.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
|
@ -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
|
||||
{
|
@ -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
|
||||
{
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
6
Plugins/Wox.Plugin.Program/Languages/en.xaml
Normal file
@ -0,0 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
|
||||
</ResourceDictionary>
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Wox.Infrastructure;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins.Program
|
||||
namespace Wox.Plugin.Program
|
||||
{
|
||||
[Serializable]
|
||||
public class Program
|
@ -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<ProgramCacheStorage>
|
@ -1,10 +1,10 @@
|
||||
<UserControl x:Class="Wox.Plugin.SystemPlugins.Program.ProgramSetting"
|
||||
<UserControl x:Class="Wox.Plugin.Program.ProgramSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:infrastructure="clr-namespace:Wox.Infrastructure;assembly=Wox.Infrastructure"
|
||||
xmlns:program="clr-namespace:Wox.Plugin.SystemPlugins.Program"
|
||||
xmlns:program="clr-namespace:Wox.Plugin.Program"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="600">
|
||||
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ProgramSetting.xaml
|
@ -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)]
|
@ -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)]
|
@ -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
|
@ -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)]
|
@ -1,4 +1,4 @@
|
||||
<Window x:Class="Wox.Plugin.SystemPlugins.Program.ProgramSuffixes"
|
||||
<Window x:Class="Wox.Plugin.Program.ProgramSuffixes"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
@ -1,19 +1,7 @@
|
||||
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;
|
||||
using System.Windows;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins.Program
|
||||
namespace Wox.Plugin.Program
|
||||
{
|
||||
/// <summary>
|
||||
/// ProgramSuffixes.xaml 的交互逻辑
|
@ -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<Program> programs = new List<Program>();
|
||||
@ -25,7 +21,7 @@ namespace Wox.Plugin.SystemPlugins.Program
|
||||
};
|
||||
private PluginInitContext context;
|
||||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
if (query.RawQuery.Trim().Length <= 1) return new List<Result>();
|
||||
|
||||
@ -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()
|
36
Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
@ -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
|
||||
{
|
124
Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{FDB3555B-58EF-4AE6-B5F1-904719637AB4}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Program</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Program</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Program\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FileChangeWatcher.cs" />
|
||||
<Compile Include="IProgramSource.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="ProgramCacheStorage.cs" />
|
||||
<Compile Include="Programs.cs" />
|
||||
<Compile Include="ProgramSetting.xaml.cs">
|
||||
<DependentUpon>ProgramSetting.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProgramSources\AppPathsProgramSource.cs" />
|
||||
<Compile Include="ProgramSources\CommonStartMenuProgramSource.cs" />
|
||||
<Compile Include="ProgramSources\FileSystemProgramSource.cs" />
|
||||
<Compile Include="ProgramSources\UserStartMenuProgramSource.cs" />
|
||||
<Compile Include="ProgramSuffixes.xaml.cs">
|
||||
<DependentUpon>ProgramSuffixes.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StringEmptyConverter.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\program.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Content Include="Languages\en.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="ProgramSetting.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ProgramSuffixes.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
5
Plugins/Wox.Plugin.Program/packages.config
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.3" targetFramework="net35" />
|
||||
<package id="Newtonsoft.Json" version="6.0.7" targetFramework="net35" />
|
||||
</packages>
|
12
Plugins/Wox.Plugin.Program/plugin.json
Normal file
@ -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"
|
||||
}
|
BIN
Plugins/Wox.Plugin.Sys/Images/app.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 613 B After Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
36
Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
@ -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<Result> availableResults = new List<Result>();
|
||||
|
||||
@ -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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
|
||||
@ -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
|
@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="Wox.Plugin.SystemPlugins.Sys.SysSettings"
|
||||
<UserControl x:Class="Wox.Plugin.Sys.SysSettings"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
17
Plugins/Wox.Plugin.Sys/SysSettings.xaml.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Wox.Plugin.Sys {
|
||||
/// <summary>
|
||||
/// Interaction logic for SysSettings.xaml
|
||||
/// </summary>
|
||||
public partial class SysSettings : UserControl {
|
||||
public SysSettings(List<Result> Results) {
|
||||
InitializeComponent();
|
||||
|
||||
foreach (var Result in Results) {
|
||||
this.lbxCommands.Items.Add(Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0B9DE348-9361-4940-ADB6-F5953BFFCCEC}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Sys</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Sys</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Sys\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Sys.cs" />
|
||||
<Compile Include="SysSettings.xaml.cs">
|
||||
<DependentUpon>SysSettings.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="SysSettings.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\lock.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\exit.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\logoff.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\close.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\app.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\restart.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
4
Plugins/Wox.Plugin.Sys/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.3" targetFramework="net35" />
|
||||
</packages>
|
12
Plugins/Wox.Plugin.Sys/plugin.json
Normal file
@ -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"
|
||||
}
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
36
Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
@ -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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
if(string.IsNullOrEmpty(query.RawQuery)) return new List<Result>();
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
71
Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A3DCCBCA-ACC1-421D-B16E-210896234C26}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Url</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Url</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Url\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UrlPlugin.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\url.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
12
Plugins/Wox.Plugin.Url/plugin.json
Normal file
@ -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"
|
||||
}
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
36
Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs
Normal file
@ -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")]
|
@ -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
|
||||
{
|
@ -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
|
||||
{
|
@ -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
|
||||
{
|
@ -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
|
||||
{
|
@ -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<Result> QueryInternal(Query query)
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
List<Result> results = new List<Result>();
|
||||
|
||||
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()
|
@ -1,4 +1,4 @@
|
||||
<Window x:Class="Wox.Plugin.SystemPlugins.WebSearchSetting"
|
||||
<Window x:Class="Wox.Plugin.WebSearch.WebSearchSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
ResizeMode="NoResize"
|
@ -1,30 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Microsoft.Win32;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins
|
||||
namespace Wox.Plugin.WebSearch
|
||||
{
|
||||
public partial class WebSearchSetting : Window
|
||||
{
|
||||
private string defaultWebSearchImageDirectory = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Images\\websearch");
|
||||
private string defaultWebSearchImageDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images\\websearch");
|
||||
private WebSearchesSetting settingWindow;
|
||||
private bool update;
|
||||
private WebSearch updateWebSearch;
|
||||
private Infrastructure.Storage.UserSettings.WebSearch updateWebSearch;
|
||||
|
||||
public WebSearchSetting(WebSearchesSetting settingWidow)
|
||||
{
|
||||
@ -32,7 +22,7 @@ namespace Wox.Plugin.SystemPlugins
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void UpdateItem(WebSearch webSearch)
|
||||
public void UpdateItem(Infrastructure.Storage.UserSettings.WebSearch webSearch)
|
||||
{
|
||||
updateWebSearch = UserSettingStorage.Instance.WebSearches.FirstOrDefault(o => 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"
|
@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="Wox.Plugin.SystemPlugins.WebSearchesSetting"
|
||||
<UserControl x:Class="Wox.Plugin.WebSearch.WebSearchesSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
@ -4,7 +4,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins
|
||||
namespace Wox.Plugin.WebSearch
|
||||
{
|
||||
/// <summary>
|
||||
/// 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);
|
125
Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{403B57F2-1856-4FC7-8A24-36AB346B763E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.WebSearch</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.WebSearch</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.WebSearch\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\..\packages\log4net.2.0.3\lib\net35-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SuggestionSources\Baidu.cs" />
|
||||
<Compile Include="SuggestionSources\Google.cs" />
|
||||
<Compile Include="SuggestionSources\ISuggestionSource.cs" />
|
||||
<Compile Include="SuggestionSources\SuggestionSourceFactory.cs" />
|
||||
<Compile Include="WebSearchesSetting.xaml.cs">
|
||||
<DependentUpon>WebSearchesSetting.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebSearchPlugin.cs" />
|
||||
<Compile Include="WebSearchSetting.xaml.cs">
|
||||
<DependentUpon>WebSearchSetting.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="WebSearchesSetting.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="WebSearchSetting.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Service References\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\web_search.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\websearch\google.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Images\websearch\wiki.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
5
Plugins/Wox.Plugin.WebSearch/packages.config
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.3" targetFramework="net35" />
|
||||
<package id="Newtonsoft.Json" version="6.0.7" targetFramework="net35" />
|
||||
</packages>
|
12
Plugins/Wox.Plugin.WebSearch/plugin.json
Normal file
@ -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"
|
||||
}
|
14
Wox.Core/Exception/WoxI18nException.cs
Normal file
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -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<Type> types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && (o.BaseType == typeof(BaseSystemPlugin) || o.GetInterfaces().Contains(typeof(IPlugin)))).ToList();
|
||||
List<Type> 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);
|
||||
}
|
||||
|
@ -25,10 +25,9 @@ namespace Wox.Core.Plugin
|
||||
public static List<PluginMetadata> Parse(List<string> 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;
|
||||
|
||||
|