Merge master

This commit is contained in:
bao-qian
2015-12-13 13:32:30 +00:00
82 changed files with 687 additions and 736 deletions

View File

@@ -176,8 +176,7 @@ namespace Wox.Plugin.CMD
private void OnWinRPressed() private void OnWinRPressed()
{ {
context.API.ShowApp(); context.API.ShowApp();
// todo don't hardcode action keywords. context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeperater}");
context.API.ChangeQuery($">{Plugin.Query.TermSeperater}");
} }
public Control CreateSettingPanel() public Control CreateSettingPanel()

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.CMD")] [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: Guid("9283a32d-5d3c-4231-96e0-2150ed4716b9")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -34,8 +34,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
@@ -55,6 +55,9 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CMD.cs" /> <Compile Include="CMD.cs" />
<Compile Include="CMDSetting.xaml.cs"> <Compile Include="CMDSetting.xaml.cs">
<DependentUpon>CMDSetting.xaml</DependentUpon> <DependentUpon>CMDSetting.xaml</DependentUpon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="InputSimulator" version="1.0.4.0" targetFramework="net452" /> <package id="InputSimulator" version="1.0.4.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages> </packages>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Caculator")] [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: Guid("ba698b90-59ed-4c2e-bce1-497eb2f9e76f")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -44,6 +44,9 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Calculator.cs" /> <Compile Include="Calculator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Color")] [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: Guid("46b03f84-5bf7-4ed4-a69b-f0274c8b3776")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -38,6 +38,9 @@
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Color.cs" /> <Compile Include="Color.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.ControlPanel")] [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: Guid("59141b10-8941-4e90-a0a6-bc9385a04cc6")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -38,6 +38,9 @@
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="ControlPanel.cs" /> <Compile Include="ControlPanel.cs" />
<Compile Include="ControlPanelItem.cs" /> <Compile Include="ControlPanelItem.cs" />
<Compile Include="ControlPanelList.cs" /> <Compile Include="ControlPanelList.cs" />

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Everything")] [assembly: AssemblyTitle("Wox.Plugin.Everything")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.Plugin.Everything")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("97f6ccd0-e9dc-4aa2-b4ce-6b9f14ea20a7")] [assembly: Guid("97f6ccd0-e9dc-4aa2-b4ce-6b9f14ea20a7")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -38,12 +38,8 @@
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Exceptionless.Portable, Version=3.1.1416.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Exceptionless.Portable.3.1.1416\lib\net45\Exceptionless.Portable.dll</HintPath> <HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
@@ -52,6 +48,9 @@
<Reference Include="System.ServiceProcess" /> <Reference Include="System.ServiceProcess" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Everything\Exceptions\CreateThreadException.cs" /> <Compile Include="Everything\Exceptions\CreateThreadException.cs" />
<Compile Include="Everything\Exceptions\CreateWindowException.cs" /> <Compile Include="Everything\Exceptions\CreateWindowException.cs" />
<Compile Include="Everything\EverythingAPI.cs" /> <Compile Include="Everything\EverythingAPI.cs" />

View File

@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Exceptionless.Portable" version="3.1.1416" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" />
</packages> </packages>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Folder")] [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: Guid("e047418e-f7b0-4a3a-b855-0bef7178179f")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -34,8 +34,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
@@ -51,6 +51,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="FolderLink.cs" /> <Compile Include="FolderLink.cs" />
<Compile Include="FolderPlugin.cs" /> <Compile Include="FolderPlugin.cs" />
<Compile Include="FolderPluginSettings.xaml.cs"> <Compile Include="FolderPluginSettings.xaml.cs">

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages> </packages>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.PluginIndicator")] [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: Guid("27f6d9fc-340b-47be-90ea-2a86bfca7bad")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -36,6 +36,9 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PluginIndicator.cs" /> <Compile Include="PluginIndicator.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -14,7 +14,7 @@ namespace Wox.Plugin.PluginManagement
{ {
public class Main : IPlugin, IPluginI18n public class Main : IPlugin, IPluginI18n
{ {
private static string APIBASE = "https://api.getwox.com"; private static string APIBASE = "http://api.getwox.com";
private static string PluginConfigName = "plugin.json"; private static string PluginConfigName = "plugin.json";
private static string pluginSearchUrl = APIBASE + "/plugin/search/"; private static string pluginSearchUrl = APIBASE + "/plugin/search/";
private const string ListCommand = "list"; private const string ListCommand = "list";
@@ -205,22 +205,19 @@ namespace Wox.Plugin.PluginManagement
private void UnInstallPlugin(PluginMetadata plugin) private void UnInstallPlugin(PluginMetadata plugin)
{ {
string content = string.Format("Do you want to uninstall following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}", plugin.Name, plugin.Version, plugin.Author); string content = $"Do you want to uninstall following plugin?{Environment.NewLine}{Environment.NewLine}" +
$"Name: {plugin.Name}{Environment.NewLine}" +
$"Version: {plugin.Version}{Environment.NewLine}" +
$"Author: {plugin.Author}";
if (MessageBox.Show(content, "Wox", MessageBoxButton.YesNo) == MessageBoxResult.Yes) if (MessageBox.Show(content, "Wox", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{ {
File.Create(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")).Close(); File.Create(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")).Close();
if (MessageBox.Show( var result = MessageBox.Show($"You have uninstalled plugin {plugin.Name} successfully.{Environment.NewLine}" +
"You have uninstalled plugin " + plugin.Name + " successfully.\r\n Restart Wox to take effect?", "Restart Wox to take effect?",
"Install plugin", "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question);
MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
{ {
ProcessStartInfo Info = new ProcessStartInfo(); context.API.RestarApp();
Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Assembly.GetExecutingAssembly().Location + "\"";
Info.WindowStyle = ProcessWindowStyle.Hidden;
Info.CreateNoWindow = true;
Info.FileName = "cmd.exe";
Process.Start(Info);
context.API.CloseApp();
} }
} }
} }

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.PluginManagement")] [assembly: AssemblyTitle("Wox.Plugin.PluginManagement")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.Plugin.PluginManagement")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("92b59bab-5c8c-414b-a8d7-326c7be3a11d")] [assembly: Guid("92b59bab-5c8c-414b-a8d7-326c7be3a11d")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -34,16 +34,21 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Presentation" /> <Reference Include="System.Windows.Presentation" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="HttpRequest.cs" /> <Compile Include="HttpRequest.cs" />
<Compile Include="Main.cs" /> <Compile Include="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages> </packages>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Program")] [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: Guid("82f60d9a-9280-4b6a-8b21-f3c694cb7e1d")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -34,9 +34,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
@@ -50,6 +49,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="AddProgramSource.xaml" /> <Page Include="AddProgramSource.xaml" />
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AddProgramSource.xaml.cs"> <Compile Include="AddProgramSource.xaml.cs">
<DependentUpon>AddProgramSource.xaml</DependentUpon> <DependentUpon>AddProgramSource.xaml</DependentUpon>
</Compile> </Compile>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages> </packages>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -6,12 +6,14 @@
<system:String x:Key="wox_plugin_sys_desc">Description</system:String> <system:String x:Key="wox_plugin_sys_desc">Description</system:String>
<system:String x:Key="wox_plugin_sys_shutdown_computer">Shutdown Computer</system:String> <system:String x:Key="wox_plugin_sys_shutdown_computer">Shutdown Computer</system:String>
<system:String x:Key="wox_plugin_sys_restart_computer">Restart Computer</system:String>
<system:String x:Key="wox_plugin_sys_log_off">Log off</system:String> <system:String x:Key="wox_plugin_sys_log_off">Log off</system:String>
<system:String x:Key="wox_plugin_sys_lock">Lock this computer</system:String> <system:String x:Key="wox_plugin_sys_lock">Lock this computer</system:String>
<system:String x:Key="wox_plugin_sys_exit">Close Wox</system:String> <system:String x:Key="wox_plugin_sys_exit">Close Wox</system:String>
<system:String x:Key="wox_plugin_sys_restart">Restart Wox</system:String> <system:String x:Key="wox_plugin_sys_restart">Restart Wox</system:String>
<system:String x:Key="wox_plugin_sys_setting">Tweak this app</system:String> <system:String x:Key="wox_plugin_sys_setting">Tweak this app</system:String>
<system:String x:Key="wox_plugin_sys_sleep">Put computer to sleep</system:String> <system:String x:Key="wox_plugin_sys_sleep">Put computer to sleep</system:String>
<system:String x:Key="wox_plugin_sys_emptyrecyclebin">Empty recycle bin</system:String>
<system:String x:Key="wox_plugin_sys_plugin_name">System Commands</system:String> <system:String x:Key="wox_plugin_sys_plugin_name">System Commands</system:String>
<system:String x:Key="wox_plugin_sys_plugin_description">Provide System related commands. e.g. shutdown,lock,setting etc.</system:String> <system:String x:Key="wox_plugin_sys_plugin_description">Provide System related commands. e.g. shutdown,lock,setting etc.</system:String>

View File

@@ -6,12 +6,14 @@
<system:String x:Key="wox_plugin_sys_desc">描述</system:String> <system:String x:Key="wox_plugin_sys_desc">描述</system:String>
<system:String x:Key="wox_plugin_sys_shutdown_computer">关闭电脑</system:String> <system:String x:Key="wox_plugin_sys_shutdown_computer">关闭电脑</system:String>
<system:String x:Key="wox_plugin_sys_restart_computer">Restart Computer</system:String>
<system:String x:Key="wox_plugin_sys_log_off">注销</system:String> <system:String x:Key="wox_plugin_sys_log_off">注销</system:String>
<system:String x:Key="wox_plugin_sys_lock">锁定这台电脑</system:String> <system:String x:Key="wox_plugin_sys_lock">锁定这台电脑</system:String>
<system:String x:Key="wox_plugin_sys_exit">退出Wox</system:String> <system:String x:Key="wox_plugin_sys_exit">退出Wox</system:String>
<system:String x:Key="wox_plugin_sys_restart">重启Wox</system:String> <system:String x:Key="wox_plugin_sys_restart">重启Wox</system:String>
<system:String x:Key="wox_plugin_sys_setting">设置</system:String> <system:String x:Key="wox_plugin_sys_setting">设置</system:String>
<system:String x:Key="wox_plugin_sys_sleep">休眠这台电脑</system:String> <system:String x:Key="wox_plugin_sys_sleep">休眠这台电脑</system:String>
<system:String x:Key="wox_plugin_sys_emptyrecyclebin">Empty recycle bin</system:String>
<system:String x:Key="wox_plugin_sys_plugin_name">系统命令</system:String> <system:String x:Key="wox_plugin_sys_plugin_name">系统命令</system:String>
<system:String x:Key="wox_plugin_sys_plugin_description">系统系统相关的命令。例如,关机,锁定,设置等</system:String> <system:String x:Key="wox_plugin_sys_plugin_description">系统系统相关的命令。例如,关机,锁定,设置等</system:String>

View File

@@ -6,12 +6,14 @@
<system:String x:Key="wox_plugin_sys_desc">描述</system:String> <system:String x:Key="wox_plugin_sys_desc">描述</system:String>
<system:String x:Key="wox_plugin_sys_shutdown_computer">關閉電腦</system:String> <system:String x:Key="wox_plugin_sys_shutdown_computer">關閉電腦</system:String>
<system:String x:Key="wox_plugin_sys_restart_computer">Restart Computer</system:String>
<system:String x:Key="wox_plugin_sys_log_off">註銷</system:String> <system:String x:Key="wox_plugin_sys_log_off">註銷</system:String>
<system:String x:Key="wox_plugin_sys_lock">鎖定這臺電腦</system:String> <system:String x:Key="wox_plugin_sys_lock">鎖定這臺電腦</system:String>
<system:String x:Key="wox_plugin_sys_exit">退出Wox</system:String> <system:String x:Key="wox_plugin_sys_exit">退出Wox</system:String>
<system:String x:Key="wox_plugin_sys_restart">重啟Wox</system:String> <system:String x:Key="wox_plugin_sys_restart">重啟Wox</system:String>
<system:String x:Key="wox_plugin_sys_setting">設置</system:String> <system:String x:Key="wox_plugin_sys_setting">設置</system:String>
<system:String x:Key="wox_plugin_sys_sleep">休眠这台电脑</system:String> <system:String x:Key="wox_plugin_sys_sleep">休眠这台电脑</system:String>
<system:String x:Key="wox_plugin_sys_emptyrecyclebin">Empty recycle bin</system:String>
<system:String x:Key="wox_plugin_sys_plugin_name">系統命令</system:String> <system:String x:Key="wox_plugin_sys_plugin_name">系統命令</system:String>
<system:String x:Key="wox_plugin_sys_plugin_description">系統系統相關的命令。例如,關機,鎖定,設置等</system:String> <system:String x:Key="wox_plugin_sys_plugin_description">系統系統相關的命令。例如,關機,鎖定,設置等</system:String>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Sys")] [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: Guid("e1eecff6-3f25-424d-9bbd-cbd7d6e1e11e")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,10 +1,14 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows;
using System.Windows.Interop;
using Wox.Infrastructure; using Wox.Infrastructure;
using FormsApplication = System.Windows.Forms.Application;
using PowerState = System.Windows.Forms.PowerState;
using Control = System.Windows.Controls.Control; using Control = System.Windows.Controls.Control;
namespace Wox.Plugin.Sys namespace Wox.Plugin.Sys
@@ -22,11 +26,23 @@ namespace Wox.Plugin.Sys
internal const int EWX_FORCE = 0x00000004; internal const int EWX_FORCE = 0x00000004;
internal const int EWX_POWEROFF = 0x00000008; internal const int EWX_POWEROFF = 0x00000008;
internal const int EWX_FORCEIFHUNG = 0x00000010; internal const int EWX_FORCEIFHUNG = 0x00000010;
[DllImport("user32")] [DllImport("user32")]
private static extern bool ExitWindowsEx(uint uFlags, uint dwReason); private static extern bool ExitWindowsEx(uint uFlags, uint dwReason);
[DllImport("user32")] [DllImport("user32")]
private static extern void LockWorkStation(); private static extern void LockWorkStation();
[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]
private static extern uint SHEmptyRecycleBin(IntPtr hWnd, uint dwFlags);
// http://www.pinvoke.net/default.aspx/Enums/HRESULT.html
private enum HRESULT : uint
{
S_FALSE = 0x0001,
S_OK = 0x0000
}
#endregion #endregion
public Control CreateSettingPanel() public Control CreateSettingPanel()
@@ -58,7 +74,8 @@ namespace Wox.Plugin.Sys
private void LoadCommands() private void LoadCommands()
{ {
availableResults.AddRange(new Result[] { availableResults.AddRange(new Result[]
{
new Result new Result
{ {
Title = "Shutdown", Title = "Shutdown",
@@ -66,13 +83,32 @@ namespace Wox.Plugin.Sys
IcoPath = "Images\\exit.png", IcoPath = "Images\\exit.png",
Action = (c) => Action = (c) =>
{ {
if (MessageBox.Show("Are you sure you want to shut the computer down?","Shutdown Computer?",MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.Yes) { var reuslt = MessageBox.Show("Are you sure you want to shut the computer down?",
"Shutdown Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (reuslt == MessageBoxResult.Yes)
{
Process.Start("shutdown", "/s /t 0"); Process.Start("shutdown", "/s /t 0");
} }
return true; return true;
} }
}, },
new Result new Result
{
Title = "Restart",
SubTitle = context.API.GetTranslation("wox_plugin_sys_restart_computer"),
IcoPath = "Images\\restartcomp.png",
Action = (c) =>
{
var result = MessageBox.Show("Are you sure you want to restart the computer?",
"Restart Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes)
{
Process.Start("shutdown", "/r /t 0");
}
return true;
}
},
new Result
{ {
Title = "Log off", Title = "Log off",
SubTitle = context.API.GetTranslation("wox_plugin_sys_log_off"), SubTitle = context.API.GetTranslation("wox_plugin_sys_log_off"),
@@ -95,7 +131,27 @@ namespace Wox.Plugin.Sys
Title = "Sleep", Title = "Sleep",
SubTitle = context.API.GetTranslation("wox_plugin_sys_sleep"), SubTitle = context.API.GetTranslation("wox_plugin_sys_sleep"),
IcoPath = "Images\\sleep.png", IcoPath = "Images\\sleep.png",
Action = (c) => Application.SetSuspendState(PowerState.Suspend, false, false) Action = (c) => FormsApplication.SetSuspendState(PowerState.Suspend, false, false)
},
new Result
{
Title = "Empty Recycle Bin",
SubTitle = context.API.GetTranslation("wox_plugin_sys_emptyrecyclebin"),
IcoPath = "Images\\recyclebin.png",
Action = (c) =>
{
// http://www.pinvoke.net/default.aspx/shell32/SHEmptyRecycleBin.html
// 0 for nothing
var result = SHEmptyRecycleBin(new WindowInteropHelper(Application.Current.MainWindow).Handle, 0);
if (result != (uint) HRESULT.S_OK)
{
MessageBox.Show($"Error emptying recycle bin, error code: {result}\n" +
"please refer to https://msdn.microsoft.com/en-us/library/windows/desktop/aa378137",
"Error",
MessageBoxButton.OK, MessageBoxImage.Error);
}
return true;
}
}, },
new Result new Result
{ {
@@ -115,14 +171,8 @@ namespace Wox.Plugin.Sys
IcoPath = "Images\\restart.png", IcoPath = "Images\\restart.png",
Action = (c) => Action = (c) =>
{ {
ProcessStartInfo Info = new ProcessStartInfo(); context.API.RestarApp();
Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\""; return false;
Info.WindowStyle = ProcessWindowStyle.Hidden;
Info.CreateNoWindow = true;
Info.FileName = "cmd.exe";
Process.Start(Info);
context.API.CloseApp();
return true;
} }
}, },
new Result new Result
@@ -142,7 +192,6 @@ namespace Wox.Plugin.Sys
public string GetLanguagesFolder() public string GetLanguagesFolder()
{ {
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages"); return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
} }
public string GetTranslatedPluginTitle() public string GetTranslatedPluginTitle()

View File

@@ -47,6 +47,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Sys.cs" /> <Compile Include="Sys.cs" />
<Compile Include="SysSettings.xaml.cs"> <Compile Include="SysSettings.xaml.cs">
@@ -64,6 +67,12 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Images\recyclebin.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\restartcomp.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\sleep.png"> <Content Include="Images\sleep.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.Url")] [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: Guid("ea42b60d-34ff-4656-8ee1-012afa397d3e")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -37,6 +37,9 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UrlPlugin.cs" /> <Compile Include="UrlPlugin.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Plugin.WebSearch")] [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: Guid("42c17706-44ba-4549-ab66-7bd994706cd1")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -34,8 +34,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
@@ -50,6 +50,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Properties\Annotations.cs" /> <Compile Include="Properties\Annotations.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SuggestionSources\Baidu.cs" /> <Compile Include="SuggestionSources\Baidu.cs" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages> </packages>

View File

@@ -1,13 +1,6 @@
Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox)
========= =========
[Wox](https://www.getwox.com/) is a launcher for Windows, inspired by [Alfred](https://www.alfredapp.com/) and [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes!. [Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes!
Features
=========
1. Search all applications, folders, files, [bookmarks](https://www.getwox.com/plugin/16).
2. Search Web using keyword (e.g. search google with `g search_term`)
3. Build custom themes in [https://www.getwox.com/theme/builder](https://www.getwox.com/theme/builder)
4. Install plugins from [https://www.getwox.com/plugin](https://www.getwox.com/plugin)
Screenshot Screenshot
========= =========
@@ -15,6 +8,13 @@ Screenshot
<a href="https://github.com/Wox-launcher/Wox/wiki/Screenshot">More screenshots</a> <a href="https://github.com/Wox-launcher/Wox/wiki/Screenshot">More screenshots</a>
<img src="http://ww3.sinaimg.cn/large/dce48faejw1eihx6ffo8eg20zk0m8hdt.gif" /> <img src="http://ww3.sinaimg.cn/large/dce48faejw1eihx6ffo8eg20zk0m8hdt.gif" />
Features
=========
1. Search all applications, folders, files, [bookmarks](http://www.getwox.com/plugin/16).
2. Search Web using keyword (e.g. search google with `g search_term`)
3. Build custom themes in [http://www.getwox.com/theme/builder](http://www.getwox.com/theme/builder)
4. Install plugins from [http://www.getwox.com/plugin](http://www.getwox.com/plugin)
Installation Installation
========= =========
@@ -33,7 +33,7 @@ Simple Usage
Contribute Contribute
========= =========
If you are a developer, please feel free to send a pull request to the **Dev** branch. We still have a lot of features and bugs to resolve. Take a look at [issues page](https://github.com/Wox-launcher/Wox/issues) if you want to contribute :) If you are a developer, please feel free to send a pull request to the **Dev** branch. We still have a lot of features and bugs to resolve. Take a look at [issues page](https://github.com/Wox-launcher/Wox/issues), especially for [help_needed](https://github.com/Wox-launcher/Wox/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp_needed) labeled issue. :)
If you are not a developer, please install the [Latest build](https://ci.appveyor.com/project/qianlifeng/wox/history) and report bugs (how to: [English](https://github.com/Wox-launcher/Wox/wiki/FAQ-English) [中文](https://github.com/Wox-launcher/Wox/wiki/FAQ-%E4%B8%AD%E6%96%87)). Feedback is always welcome! If you are not a developer, please install the [Latest build](https://ci.appveyor.com/project/qianlifeng/wox/history) and report bugs (how to: [English](https://github.com/Wox-launcher/Wox/wiki/FAQ-English) [中文](https://github.com/Wox-launcher/Wox/wiki/FAQ-%E4%B8%AD%E6%96%87)). Feedback is always welcome!

21
SolutionAssemblyInfo.cs Normal file
View File

@@ -0,0 +1,21 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Debug build, https://github.com/Wox-launcher/Wox")]
#else
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Release build, https://github.com/Wox-launcher/Wox")]
#endif
[assembly: AssemblyCompany("Wox-launcher")]
[assembly: AssemblyProduct("Wox")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyInformationalVersion("1.2-beta.2")]

View File

@@ -1,10 +1,10 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Windows.Forms;
using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Zip;
using Newtonsoft.Json; using Newtonsoft.Json;
using Wox.Plugin; using Wox.Plugin;
using System.Windows;
namespace Wox.Core.Plugin namespace Wox.Core.Plugin
{ {
@@ -47,22 +47,24 @@ namespace Wox.Core.Plugin
.Replace("*", "_") .Replace("*", "_")
.Replace("|", "_") .Replace("|", "_")
+ "-" + Guid.NewGuid(); + "-" + Guid.NewGuid();
string newPluginPath = Path.Combine(pluginFolerPath,newPluginName); string newPluginPath = Path.Combine(pluginFolerPath, newPluginName);
string content = string.Format( string content = $"Do you want to install following plugin?{Environment.NewLine}{Environment.NewLine}" +
"Do you want to install following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}", $"Name: {plugin.Name}{Environment.NewLine}" +
plugin.Name, plugin.Version, plugin.Author); $"Version: {plugin.Version}{Environment.NewLine}" +
$"Author: {plugin.Author}";
PluginPair existingPlugin = PluginManager.GetPluginForId(plugin.ID); PluginPair existingPlugin = PluginManager.GetPluginForId(plugin.ID);
if (existingPlugin != null) if (existingPlugin != null)
{ {
content = string.Format( content = $"Do you want to update following plugin?{Environment.NewLine}{Environment.NewLine}" +
"Do you want to update following plugin?\r\n\r\nName: {0}\r\nOld Version: {1}\r\nNew Version: {2}\r\nAuthor: {3}", $"Name: {plugin.Name}{Environment.NewLine}" +
plugin.Name, existingPlugin.Metadata.Version, plugin.Version, plugin.Author); $"Old Version: {existingPlugin.Metadata.Version}" +
$"{Environment.NewLine}New Version: {plugin.Version}" +
$"{Environment.NewLine}Author: {plugin.Author}";
} }
DialogResult result = System.Windows.Forms.MessageBox.Show(content, "Install plugin", MessageBoxButtons.YesNo, var result = MessageBox.Show(content, "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question);
MessageBoxIcon.Question); if (result == MessageBoxResult.Yes)
if (result == DialogResult.Yes)
{ {
if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirectory)) if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirectory))
{ {
@@ -81,17 +83,11 @@ namespace Wox.Core.Plugin
//{ //{
// Plugins.Init(); // Plugins.Init();
//} //}
if (MessageBox.Show("You have installed plugin " + plugin.Name + " successfully.\r\n Restart Wox to take effect?", "Install plugin", if (MessageBox.Show($"You have installed plugin {plugin.Name} successfully.{Environment.NewLine}" +
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) " Restart Wox to take effect?",
"Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
{ {
ProcessStartInfo Info = new ProcessStartInfo(); PluginManager.API.RestarApp();
Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" +
System.Windows.Forms.Application.ExecutablePath + "\"";
Info.WindowStyle = ProcessWindowStyle.Hidden;
Info.CreateNoWindow = true;
Info.FileName = "cmd.exe";
Process.Start(Info);
PluginManager.API.CloseApp();
} }
} }
} }
@@ -114,7 +110,7 @@ namespace Wox.Core.Plugin
} }
catch (System.Exception) catch (System.Exception)
{ {
string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath); string error = $"Parse plugin config {configPath} failed: json format is not valid";
#if (DEBUG) #if (DEBUG)
{ {
throw new System.Exception(error); throw new System.Exception(error);
@@ -126,8 +122,7 @@ namespace Wox.Core.Plugin
if (!AllowedLanguage.IsAllowed(metadata.Language)) if (!AllowedLanguage.IsAllowed(metadata.Language))
{ {
string error = string.Format("Parse plugin config {0} failed: invalid language {1}", configPath, string error = $"Parse plugin config {configPath} failed: invalid language {metadata.Language}";
metadata.Language);
#if (DEBUG) #if (DEBUG)
{ {
throw new System.Exception(error); throw new System.Exception(error);
@@ -137,8 +132,7 @@ namespace Wox.Core.Plugin
} }
if (!File.Exists(metadata.ExecuteFilePath)) if (!File.Exists(metadata.ExecuteFilePath))
{ {
string error = string.Format("Parse plugin config {0} failed: ExecuteFile {1} didn't exist", configPath, string error = $"Parse plugin config {configPath} failed: ExecuteFile {metadata.ExecuteFilePath} didn't exist";
metadata.ExecuteFilePath);
#if (DEBUG) #if (DEBUG)
{ {
throw new System.Exception(error); throw new System.Exception(error);

View File

@@ -79,7 +79,7 @@ namespace Wox.Core.Plugin
Concat(new JsonRPCPluginLoader<PythonPlugin>().LoadPlugin(metadatas)); Concat(new JsonRPCPluginLoader<PythonPlugin>().LoadPlugin(metadatas));
//load plugin i18n languages //load plugin i18n languages
ResourceMerger.ApplyPluginLanguages(); ResourceMerger.UpdatePluginLanguages();
foreach (PluginPair pluginPair in AllPlugins) foreach (PluginPair pluginPair in AllPlugins)
{ {

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Wox.Core")] [assembly: AssemblyTitle("Wox.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.Core")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("693aa0e5-741b-4759-b740-fdbb011a3280")] [assembly: Guid("693aa0e5-741b-4759-b740-fdbb011a3280")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,10 +0,0 @@
using System.Collections.Generic;
namespace Wox.Core.Theme
{
interface ITheme
{
void ChangeTheme(string themeName);
List<string> LoadAvailableThemes();
}
}

View File

@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media; using System.Windows.Media;
using Wox.Core.UI; using Wox.Core.UI;
using Wox.Core.UserSettings; using Wox.Core.UserSettings;
@@ -12,7 +14,7 @@ using Wox.Infrastructure.Logger;
namespace Wox.Core.Theme namespace Wox.Core.Theme
{ {
public class Theme : IUIResource,ITheme public class Theme : IUIResource
{ {
public const string DirectoryName = "Themes"; public const string DirectoryName = "Themes";
private static List<string> themeDirectories = new List<string>(); private static List<string> themeDirectories = new List<string>();
@@ -55,8 +57,14 @@ namespace Wox.Core.Theme
UserSettingStorage.Instance.Theme = themeName; UserSettingStorage.Instance.Theme = themeName;
UserSettingStorage.Instance.Save(); UserSettingStorage.Instance.Save();
ResourceMerger.UpdateResource(this);
ResourceMerger.ApplyThemeResource(this); // Exception of FindResource can't be cathed if global exception handle is set
var isBlur = Application.Current.TryFindResource("ThemeBlurEnabled");
if (isBlur is bool)
{
SetBlurForWindow(Application.Current.MainWindow, (bool)isBlur);
}
} }
public ResourceDictionary GetResourceDictionary() public ResourceDictionary GetResourceDictionary()
@@ -89,7 +97,6 @@ namespace Wox.Core.Theme
Setter[] setters = new Setter[] { fontFamily, fontStyle, fontWeight, fontStretch }; Setter[] setters = new Setter[] { fontFamily, fontStyle, fontWeight, fontStretch };
Array.ForEach(new Style[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p))); Array.ForEach(new Style[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
} }
return dict; return dict;
} }
@@ -119,5 +126,77 @@ namespace Wox.Core.Theme
return string.Empty; return string.Empty;
} }
#region Blur Handling
/*
Found on https://github.com/riverar/sample-win10-aeroglass
*/
private enum AccentState
{
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3,
ACCENT_INVALID_STATE = 4
}
[StructLayout(LayoutKind.Sequential)]
private struct AccentPolicy
{
public AccentState AccentState;
public int AccentFlags;
public int GradientColor;
public int AnimationId;
}
[StructLayout(LayoutKind.Sequential)]
private struct WindowCompositionAttributeData
{
public WindowCompositionAttribute Attribute;
public IntPtr Data;
public int SizeOfData;
}
private enum WindowCompositionAttribute
{
WCA_ACCENT_POLICY = 19
}
[DllImport("user32.dll")]
private static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
/// <summary>
/// Sets the blur for a window via SetWindowCompositionAttribute
/// </summary>
/// <param name="wind">window to blur</param>
/// <param name="isBlur">true/false - on or off correspondingly</param>
private void SetBlurForWindow(Window wind, bool isBlur)
{
if (isBlur)
{
SetWindowAccent(wind, AccentState.ACCENT_ENABLE_BLURBEHIND);
}
}
private void SetWindowAccent(Window wind, AccentState themeAccentMode)
{
var windowHelper = new WindowInteropHelper(wind);
var accent = new AccentPolicy { AccentState = themeAccentMode };
var accentStructSize = Marshal.SizeOf(accent);
var accentPtr = Marshal.AllocHGlobal(accentStructSize);
Marshal.StructureToPtr(accent, accentPtr, false);
var data = new WindowCompositionAttributeData
{
Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY,
SizeOfData = accentStructSize,
Data = accentPtr
};
SetWindowCompositionAttribute(windowHelper.Handle, ref data);
Marshal.FreeHGlobal(accentPtr);
}
#endregion
} }
} }

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using Wox.Core.i18n; using Wox.Core.i18n;
@@ -9,34 +10,34 @@ namespace Wox.Core.UI
{ {
public static class ResourceMerger public static class ResourceMerger
{ {
private static void RemoveResource(string resourceDirectoryName) private static void RemoveResource(string directoryName)
{ {
var mergedDictionaries = Application.Current.Resources.MergedDictionaries; directoryName = $"{Path.DirectorySeparatorChar}{directoryName}";
foreach (var resource in mergedDictionaries) var dictionaries = Application.Current.Resources.MergedDictionaries;
foreach (var resource in dictionaries)
{ {
int directoryPosition = resource.Source.Segments.Length - 2; string currentDirectoryName = Path.GetDirectoryName(resource.Source.AbsolutePath);
string currentDirectoryName = resource.Source.Segments[directoryPosition]; if (currentDirectoryName == directoryName)
if (currentDirectoryName == resourceDirectoryName)
{ {
mergedDictionaries.Remove(resource); dictionaries.Remove(resource);
break; break;
} }
} }
} }
public static void ApplyThemeResource(Theme.Theme t) public static void UpdateResource(Theme.Theme t)
{ {
RemoveResource(Theme.Theme.DirectoryName); RemoveResource(Theme.Theme.DirectoryName);
Application.Current.Resources.MergedDictionaries.Add(t.GetResourceDictionary()); Application.Current.Resources.MergedDictionaries.Add(t.GetResourceDictionary());
} }
public static void ApplyLanguageResources(Internationalization i) public static void UpdateResources(Internationalization i)
{ {
RemoveResource(Internationalization.DirectoryName); RemoveResource(Internationalization.DirectoryName);
Application.Current.Resources.MergedDictionaries.Add(i.GetResourceDictionary()); Application.Current.Resources.MergedDictionaries.Add(i.GetResourceDictionary());
} }
internal static void ApplyPluginLanguages() internal static void UpdatePluginLanguages()
{ {
RemoveResource(PluginManager.DirectoryName); RemoveResource(PluginManager.DirectoryName);
foreach (var languageFile in PluginManager.GetPluginsForInterface<IPluginI18n>(). foreach (var languageFile in PluginManager.GetPluginsForInterface<IPluginI18n>().

View File

@@ -18,7 +18,7 @@ namespace Wox.Core.Updater
public class UpdaterManager public class UpdaterManager
{ {
private static UpdaterManager instance; private static UpdaterManager instance;
private const string VersionCheckURL = "https://api.getwox.com/release/latest/"; private const string VersionCheckURL = "http://api.getwox.com/release/latest/";
private const string UpdateFeedURL = "http://upgrade.getwox.com/update.xml"; private const string UpdateFeedURL = "http://upgrade.getwox.com/update.xml";
//private const string UpdateFeedURL = "http://127.0.0.1:8888/update.xml"; //private const string UpdateFeedURL = "http://127.0.0.1:8888/update.xml";
private static SemanticVersion currentVersion; private static SemanticVersion currentVersion;

View File

@@ -117,6 +117,8 @@ namespace Wox.Core.UserSettings
get { return "config"; } get { return "config"; }
} }
public void IncreaseActivateTimes() public void IncreaseActivateTimes()
{ {
ActivateTimes++; ActivateTimes++;

View File

@@ -42,8 +42,8 @@
<HintPath>..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll</HintPath> <HintPath>..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
@@ -57,6 +57,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="APIServer.cs" /> <Compile Include="APIServer.cs" />
<Compile Include="Updater\Release.cs" /> <Compile Include="Updater\Release.cs" />
<Compile Include="Updater\UpdaterManager.cs" /> <Compile Include="Updater\UpdaterManager.cs" />
@@ -67,7 +70,6 @@
<Compile Include="i18n\Internationalization.cs" /> <Compile Include="i18n\Internationalization.cs" />
<Compile Include="i18n\InternationalizationManager.cs" /> <Compile Include="i18n\InternationalizationManager.cs" />
<Compile Include="i18n\Language.cs" /> <Compile Include="i18n\Language.cs" />
<Compile Include="Theme\ITheme.cs" />
<Compile Include="Theme\ThemeManager.cs" /> <Compile Include="Theme\ThemeManager.cs" />
<Compile Include="UI\IUIResource.cs" /> <Compile Include="UI\IUIResource.cs" />
<Compile Include="UI\ResourceMerger.cs" /> <Compile Include="UI\ResourceMerger.cs" />

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Wox.Core.i18n namespace Wox.Core.i18n
{ {
@@ -8,6 +8,7 @@ namespace Wox.Core.i18n
public static Language Chinese = new Language("zh-cn", "中文"); public static Language Chinese = new Language("zh-cn", "中文");
public static Language Chinese_TW = new Language("zh-tw", "中文(繁体)"); public static Language Chinese_TW = new Language("zh-tw", "中文(繁体)");
public static Language Russian = new Language("ru", "Русский"); public static Language Russian = new Language("ru", "Русский");
public static Language French = new Language("fr", "Français");
public static List<Language> GetAvailableLanguages() public static List<Language> GetAvailableLanguages()
{ {
@@ -17,6 +18,7 @@ namespace Wox.Core.i18n
Chinese, Chinese,
Chinese_TW, Chinese_TW,
Russian, Russian,
French,
}; };
return languages; return languages;
} }

View File

@@ -70,7 +70,7 @@ namespace Wox.Core.i18n
UserSettingStorage.Instance.Language = language.LanguageCode; UserSettingStorage.Instance.Language = language.LanguageCode;
UserSettingStorage.Instance.Save(); UserSettingStorage.Instance.Save();
ResourceMerger.ApplyLanguageResources(this); ResourceMerger.UpdateResources(this);
} }
public ResourceDictionary GetResourceDictionary() public ResourceDictionary GetResourceDictionary()
@@ -88,20 +88,15 @@ namespace Wox.Core.i18n
public string GetTranslation(string key) public string GetTranslation(string key)
{ {
try var translation = Application.Current.TryFindResource(key);
if (translation is string)
{ {
object translation = Application.Current.FindResource(key);
if (translation == null)
{
return "NoTranslation";
}
return translation.ToString(); return translation.ToString();
} }
catch else
{ {
return "NoTranslation"; return "NoTranslation";
} }
} }
private string GetLanguagePath(string languageCode) private string GetLanguagePath(string languageCode)

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NAppUpdate.Framework" version="0.3.2.0" targetFramework="net452" /> <package id="NAppUpdate.Framework" version="0.3.2.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" /> <package id="SharpZipLib" version="0.86.0" targetFramework="net452" />
</packages> </packages>

View File

@@ -1,19 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.CrashReporter")] [assembly: AssemblyTitle("Wox.CrashReporter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.CrashReporter")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("0ea3743c-2c0d-4b13-b9ce-e5e1f85aea23")] [assembly: Guid("0ea3743c-2c0d-4b13-b9ce-e5e1f85aea23")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -54,6 +54,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CrashReporter.cs" /> <Compile Include="CrashReporter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReportWindow.xaml.cs"> <Compile Include="ReportWindow.xaml.cs">

View File

@@ -1,17 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Wox.Infrastructure")] [assembly: AssemblyTitle("Wox.Infrastructure")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.Infrastructure")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("aee57a31-29e5-4f03-a41f-7917910fe90f")] [assembly: Guid("aee57a31-29e5-4f03-a41f-7917910fe90f")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -36,8 +36,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
@@ -50,6 +50,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Exception\ExceptionFormatter.cs" /> <Compile Include="Exception\ExceptionFormatter.cs" />
<Compile Include="Exception\WoxException.cs" /> <Compile Include="Exception\WoxException.cs" />
<Compile Include="Exception\WoxFatalException.cs" /> <Compile Include="Exception\WoxFatalException.cs" />

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="NLog" version="4.2.0" targetFramework="net452" /> <package id="NLog" version="4.2.0" targetFramework="net452" />
<package id="NLog.Schema" version="4.2.0" targetFramework="net452" /> <package id="NLog.Schema" version="4.2.0" targetFramework="net452" />
</packages> </packages>

View File

@@ -51,6 +51,11 @@ namespace Wox.Plugin
/// </summary> /// </summary>
void CloseApp(); void CloseApp();
/// <summary>
/// Restart Wox
/// </summary>
void RestarApp();
/// <summary> /// <summary>
/// Hide Wox /// Hide Wox
/// </summary> /// </summary>

View File

@@ -3,18 +3,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Wox.Plugin")] [assembly: AssemblyTitle("Wox.Plugin")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.Plugin")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("c22be00d-a6f5-4e45-8ecc-09ebf297c812")] [assembly: Guid("c22be00d-a6f5-4e45-8ecc-09ebf297c812")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Wox")] [assembly: InternalsVisibleTo("Wox")]
[assembly: InternalsVisibleTo("Wox.Core")] [assembly: InternalsVisibleTo("Wox.Core")]
[assembly: InternalsVisibleTo("Wox.Test")] [assembly: InternalsVisibleTo("Wox.Test")]

View File

@@ -42,6 +42,9 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AllowedLanguage.cs" /> <Compile Include="AllowedLanguage.cs" />
<Compile Include="EventHandler.cs" /> <Compile Include="EventHandler.cs" />
<Compile Include="Feature.cs" /> <Compile Include="Feature.cs" />

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.Test")] [assembly: AssemblyTitle("Wox.Test")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.Test")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c42c2b1b-ead4-498c-a06d-7cbde85760e4")] [assembly: Guid("c42c2b1b-ead4-498c-a06d-7cbde85760e4")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -45,6 +45,9 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="FuzzyMatcherTest.cs" /> <Compile Include="FuzzyMatcherTest.cs" />
<Compile Include="Plugins\PluginInitTest.cs" /> <Compile Include="Plugins\PluginInitTest.cs" />
<Compile Include="QueryTest.cs" /> <Compile Include="QueryTest.cs" />

View File

@@ -1,36 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox.UpdateFeedGenerator")] [assembly: AssemblyTitle("Wox.UpdateFeedGenerator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox.UpdateFeedGenerator")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2f3420c0-2c21-4f71-a45d-a47b5305fe20")] [assembly: Guid("2f3420c0-2c21-4f71-a45d-a47b5305fe20")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -40,8 +40,8 @@
<HintPath>..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll</HintPath> <HintPath>..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@@ -52,6 +52,9 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="ConfigStorage.cs" /> <Compile Include="ConfigStorage.cs" />
<Compile Include="FileInfoEx.cs" /> <Compile Include="FileInfoEx.cs" />
<Compile Include="FileSystemEnumerator.cs" /> <Compile Include="FileSystemEnumerator.cs" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NAppUpdate.Framework" version="0.3.2.0" targetFramework="net452" /> <package id="NAppUpdate.Framework" version="0.3.2.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages> </packages>

10
Wox.sln
View File

@@ -61,6 +61,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.UpdateFeedGenerator", "
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FFD651C7-0546-441F-BC8C-D4EE8FD01EA7}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
LICENSE = LICENSE
README.md = README.md
SolutionAssemblyInfo.cs = SolutionAssemblyInfo.cs
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU

View File

@@ -50,10 +50,16 @@ namespace Wox
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
} }
public bool OnActivate(IList<string> args) public void OnActivate(IList<string> args)
{ {
CommandArgsFactory.Execute(args); if (args.Count > 0 && args[0] == SingleInstance<App>.Restart)
return true; {
Window.CloseApp();
}
else
{
CommandArgsFactory.Execute(args);
}
} }
} }
} }

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using Wox.Helper;
namespace Wox.CommandArgs namespace Wox.CommandArgs
{ {
@@ -20,7 +21,8 @@ namespace Wox.CommandArgs
public static void Execute(IList<string> args) public static void Execute(IList<string> args)
{ {
if (args.Count > 0) // todo restart command line args?
if (args.Count > 0 && args[0] != SingleInstance<App>.Restart)
{ {
string command = args[0]; string command = args[0];
ICommandArg cmd = commandArgs.FirstOrDefault(o => o.Command.ToLower() == command); ICommandArg cmd = commandArgs.FirstOrDefault(o => o.Command.ToLower() == command);

View File

@@ -1,14 +1,4 @@
//----------------------------------------------------------------------- using System;
// <copyright file="SingleInstance.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <summary>
// This class checks to make sure that only one instance of
// this application is running at a time.
// </summary>
//-----------------------------------------------------------------------
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@@ -23,7 +13,8 @@ using System.Threading;
using System.Windows; using System.Windows;
using System.Windows.Threading; using System.Windows.Threading;
//http://blogs.microsoft.co.il/arik/2010/05/28/wpf-single-instance-application/ // http://blogs.microsoft.co.il/arik/2010/05/28/wpf-single-instance-application/
// modified to allow single instace restart
namespace Wox.Helper namespace Wox.Helper
{ {
internal enum WM internal enum WM
@@ -194,7 +185,7 @@ namespace Wox.Helper
public interface ISingleInstanceApp public interface ISingleInstanceApp
{ {
bool OnActivate(IList<string> args); void OnActivate(IList<string> args);
} }
/// <summary> /// <summary>
@@ -212,6 +203,8 @@ namespace Wox.Helper
where TApplication: Application , ISingleInstanceApp where TApplication: Application , ISingleInstanceApp
{ {
public const string Restart = "Restart";
#region Private Fields #region Private Fields
/// <summary> /// <summary>
@@ -237,7 +230,7 @@ namespace Wox.Helper
/// <summary> /// <summary>
/// Application mutex. /// Application mutex.
/// </summary> /// </summary>
private static Mutex singleInstanceMutex; internal static Mutex singleInstanceMutex;
/// <summary> /// <summary>
/// IPC channel for communications. /// IPC channel for communications.
@@ -273,6 +266,8 @@ namespace Wox.Helper
public static bool InitializeAsFirstInstance( string uniqueName ) public static bool InitializeAsFirstInstance( string uniqueName )
{ {
commandLineArgs = GetCommandLineArgs(uniqueName); commandLineArgs = GetCommandLineArgs(uniqueName);
//remove execute path itself
commandLineArgs.RemoveAt(0);
// Build unique application Id and the IPC channel name. // Build unique application Id and the IPC channel name.
string applicationIdentifier = uniqueName + Environment.UserName; string applicationIdentifier = uniqueName + Environment.UserName;
@@ -285,13 +280,21 @@ namespace Wox.Helper
if (firstInstance) if (firstInstance)
{ {
CreateRemoteService(channelName); CreateRemoteService(channelName);
return true;
}
// Restart
else if (commandLineArgs.Count > 0 && commandLineArgs[0] == Restart)
{
SignalFirstInstance(channelName, commandLineArgs);
singleInstanceMutex.WaitOne(TimeSpan.FromSeconds(10));
CreateRemoteService(channelName);
return true;
} }
else else
{ {
SignalFirstInstance(channelName, commandLineArgs); SignalFirstInstance(channelName, commandLineArgs);
return false;
} }
return firstInstance;
} }
/// <summary> /// <summary>
@@ -299,11 +302,7 @@ namespace Wox.Helper
/// </summary> /// </summary>
public static void Cleanup() public static void Cleanup()
{ {
if (singleInstanceMutex != null) singleInstanceMutex?.ReleaseMutex();
{
singleInstanceMutex.Close();
singleInstanceMutex = null;
}
if (channel != null) if (channel != null)
{ {
@@ -442,8 +441,7 @@ namespace Wox.Helper
{ {
return; return;
} }
//remove execute path itself
args.RemoveAt(0);
((TApplication)Application.Current).OnActivate(args); ((TApplication)Application.Current).OnActivate(args);
} }

View File

@@ -44,6 +44,7 @@
<system:String x:Key="windowMode">Window Mode</system:String> <system:String x:Key="windowMode">Window Mode</system:String>
<system:String x:Key="opacity">Opacity</system:String> <system:String x:Key="opacity">Opacity</system:String>
<!--Setting Hotkey--> <!--Setting Hotkey-->
<system:String x:Key="hotkey">Hotkey</system:String> <system:String x:Key="hotkey">Hotkey</system:String>
<system:String x:Key="woxHotkey">Wox Hotkey</system:String> <system:String x:Key="woxHotkey">Wox Hotkey</system:String>

128
Wox/Languages/fr.xaml Normal file
View File

@@ -0,0 +1,128 @@
<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">
<!--MainWindow-->
<system:String x:Key="registerHotkeyFailed">Échec lors de l'enregistrement du raccourci : {0}</system:String>
<system:String x:Key="couldnotStartCmd">Impossible de lancer {0}</system:String>
<system:String x:Key="invalidWoxPluginFileFormat">Le format de fichier n'est pas un plugin wox valide</system:String>
<system:String x:Key="setAsTopMostInThisQuery">Définir en tant que favori pour cette requête</system:String>
<system:String x:Key="cancelTopMostInThisQuery">Annuler le favori</system:String>
<system:String x:Key="executeQuery">Lancer la requête : {0}</system:String>
<system:String x:Key="lastExecuteTime">Dernière exécution : {0}</system:String>
<system:String x:Key="iconTrayOpen">Ouvrir</system:String>
<system:String x:Key="iconTraySettings">Paramètres</system:String>
<system:String x:Key="iconTrayAbout">À propos</system:String>
<system:String x:Key="iconTrayExit">Quitter</system:String>
<!--Setting General-->
<system:String x:Key="woxsettings">Paramètres - Wox</system:String>
<system:String x:Key="general">Général</system:String>
<system:String x:Key="startWoxOnSystemStartup">Lancer Wox au démarrage du système</system:String>
<system:String x:Key="hideWoxWhenLoseFocus">Cacher Wox lors de la perte de focus</system:String>
<system:String x:Key="dontPromptUpdateMsg">Ne pas afficher le message de mise à jour pour les nouvelles versions</system:String>
<system:String x:Key="rememberLastLocation">Se souvenir du dernier emplacement de la fenêtre</system:String>
<system:String x:Key="language">Langue</system:String>
<system:String x:Key="maxShowResults">Résultats à afficher</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignore les raccourcis lorsqu'une application est en plein écran</system:String>
<!--Setting Plugin-->
<system:String x:Key="plugin">Modules</system:String>
<system:String x:Key="browserMorePlugins">Trouver plus de modules</system:String>
<system:String x:Key="disable">Désactivé</system:String>
<system:String x:Key="actionKeywords">Mot-clé d'action :</system:String>
<system:String x:Key="pluginDirectory">Répertoire</system:String>
<system:String x:Key="author">Auteur </system:String>
<system:String x:Key="plugin_init_time">Chargement : {0}ms</system:String>
<system:String x:Key="plugin_query_time">Utilisation : {0}ms</system:String>
<!--Setting Theme-->
<system:String x:Key="theme">Thème</system:String>
<system:String x:Key="browserMoreThemes">Trouver plus de thèmes</system:String>
<system:String x:Key="helloWox">Hello Wox</system:String>
<system:String x:Key="queryBoxFont">Police (barre de recherche)</system:String>
<system:String x:Key="resultItemFont">Police (liste des résultats) </system:String>
<system:String x:Key="windowMode">Mode fenêtré</system:String>
<system:String x:Key="opacity">Opacité</system:String>
<!--Setting Hotkey-->
<system:String x:Key="hotkey">Raccourcis</system:String>
<system:String x:Key="woxHotkey">Ouvrir Wox</system:String>
<system:String x:Key="customQueryHotkey">Requêtes personnalisées</system:String>
<system:String x:Key="delete">Supprimer</system:String>
<system:String x:Key="edit">Éditer</system:String>
<system:String x:Key="add">Ajouter</system:String>
<system:String x:Key="pleaseSelectAnItem">Veuillez sélectionner un élément</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">Voulez-vous vraiment supprimer {0} raccourci(s) ?</system:String>
<!--Setting Proxy-->
<system:String x:Key="proxy">Proxy</system:String>
<system:String x:Key="enableProxy">Activer le proxy</system:String>
<system:String x:Key="server">Serveur</system:String>
<system:String x:Key="port">Port</system:String>
<system:String x:Key="userName">Utilisateur</system:String>
<system:String x:Key="password">Mot de passe</system:String>
<system:String x:Key="testProxy">Tester</system:String>
<system:String x:Key="save">Sauvegarder</system:String>
<system:String x:Key="serverCantBeEmpty">Un serveur doit être indiqué</system:String>
<system:String x:Key="portCantBeEmpty">Un port doit être indiqué</system:String>
<system:String x:Key="invalidPortFormat">Format invalide pour : port</system:String>
<system:String x:Key="saveProxySuccessfully">Proxy sauvegardé avec succès</system:String>
<system:String x:Key="proxyIsCorrect">Le proxy est valide</system:String>
<system:String x:Key="proxyConnectFailed">Connection au proxy échouée</system:String>
<!--Setting About-->
<system:String x:Key="about">À propos</system:String>
<system:String x:Key="website">Site Web</system:String>
<system:String x:Key="version">Version</system:String>
<system:String x:Key="about_activate_times">Vous avez utilisé Wox {0} fois</system:String>
<!--Action Keyword Setting Dialog-->
<system:String x:Key="oldActionKeywords">Ancien mot-clé d'action</system:String>
<system:String x:Key="newActionKeywords">Nouveau mot-clé d'action</system:String>
<system:String x:Key="cancel">Annuler</system:String>
<system:String x:Key="done">Terminé</system:String>
<system:String x:Key="cannotFindSpecifiedPlugin">Impossible de trouver le module spécifié</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Le nouveau mot-clé d'action doit être spécifié</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Le nouveau mot-clé d'action a été assigné à un autre module, veuillez en choisir un autre</system:String>
<system:String x:Key="succeed">Ajouté</system:String>
<system:String x:Key="actionkeyword_tips">Utilisez * si vous ne souhaitez pas utiliser de mot-clé spécifique</system:String>
<!--Custom Query Hotkey Dialog-->
<system:String x:Key="preview">Aperçu</system:String>
<system:String x:Key="hotkeyIsNotUnavailable">Le raccourci n'est pas disponible, choisissez en un autre</system:String>
<system:String x:Key="invalidPluginHotkey">Raccourci invalide</system:String>
<system:String x:Key="update">Actualiser</system:String>
<!--Hotkey Control-->
<system:String x:Key="hotkeyUnavailable">Raccourci non disponible</system:String>
<!--Crash Reporter-->
<system:String x:Key="reportWindow_version">Version</system:String>
<system:String x:Key="reportWindow_time">Time</system:String>
<system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String>
<system:String x:Key="reportWindow_send_report">Send Report</system:String>
<system:String x:Key="reportWindow_cancel">Cancel</system:String>
<system:String x:Key="reportWindow_general">General</system:String>
<system:String x:Key="reportWindow_exceptions">Exceptions</system:String>
<system:String x:Key="reportWindow_exception_type">Exception Type</system:String>
<system:String x:Key="reportWindow_source">Source</system:String>
<system:String x:Key="reportWindow_stack_trace">Stack Trace</system:String>
<system:String x:Key="reportWindow_sending">Sending</system:String>
<system:String x:Key="reportWindow_report_succeed">Report succeed</system:String>
<system:String x:Key="reportWindow_report_failed">Report failed</system:String>
<system:String x:Key="reportWindow_wox_got_an_error">Wox a rencontré une erreur</system:String>
<!--update-->
<system:String x:Key="update_wox_update_new_version_available">Wox version v{0} est disponible</system:String>
<system:String x:Key="update_wox_update_error">Une erreur s'est produite lors de l'installation de la mise à jour</system:String>
<system:String x:Key="update_wox_update">Mettre à jour</system:String>
<system:String x:Key="update_wox_update_cancel">Annuler</system:String>
<system:String x:Key="update_wox_update_restart_wox_tip">Wox doit redémarrer pour installer cette mise à jour</system:String>
<system:String x:Key="update_wox_update_upadte_files">Les fichiers suivants seront mis à jour</system:String>
<system:String x:Key="update_wox_update_files">Fichiers mis à jour</system:String>
<system:String x:Key="update_wox_update_upadte_description">Description de la mise à jour</system:String>
</ResourceDictionary>

View File

@@ -13,7 +13,9 @@
AllowDrop="True" AllowDrop="True"
ShowInTaskbar="False" ShowInTaskbar="False"
Style="{DynamicResource WindowStyle}" Style="{DynamicResource WindowStyle}"
Icon="Images\app.png"> Icon="Images\app.png"
AllowsTransparency="True"
>
<Border Style="{DynamicResource WindowBorderStyle}" MouseDown="Border_OnMouseDown"> <Border Style="{DynamicResource WindowBorderStyle}" MouseDown="Border_OnMouseDown">
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True" <TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True"

View File

@@ -10,7 +10,6 @@ using System.Reflection;
using System.Threading; using System.Threading;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using NHotkey; using NHotkey;
@@ -26,14 +25,10 @@ using Wox.Infrastructure.Hotkey;
using Wox.Plugin; using Wox.Plugin;
using Wox.Storage; using Wox.Storage;
using ContextMenu = System.Windows.Forms.ContextMenu; using ContextMenu = System.Windows.Forms.ContextMenu;
using DataFormats = System.Windows.DataFormats; using NotifyIcon = System.Windows.Forms.NotifyIcon;
using DragEventArgs = System.Windows.DragEventArgs; using Screen = System.Windows.Forms.Screen;
using IDataObject = System.Windows.IDataObject;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using MenuItem = System.Windows.Forms.MenuItem; using MenuItem = System.Windows.Forms.MenuItem;
using MessageBox = System.Windows.MessageBox;
using Stopwatch = Wox.Infrastructure.Stopwatch; using Stopwatch = Wox.Infrastructure.Stopwatch;
using ToolTip = System.Windows.Controls.ToolTip;
namespace Wox namespace Wox
{ {
@@ -85,12 +80,18 @@ namespace Wox
public void CloseApp() public void CloseApp()
{ {
Dispatcher.Invoke(new Action(() => notifyIcon.Visible = false;
Application.Current.Shutdown();
}
public void RestarApp()
{
ProcessStartInfo info = new ProcessStartInfo
{ {
notifyIcon.Visible = false; FileName = Application.ResourceAssembly.Location,
Close(); Arguments = SingleInstance<App>.Restart
Environment.Exit(0); };
})); Process.Start(info);
} }
public void HideApp() public void HideApp()
@@ -198,16 +199,12 @@ namespace Wox
pnlResult.ItemDropEvent += pnlResult_ItemDropEvent; pnlResult.ItemDropEvent += pnlResult_ItemDropEvent;
pnlContextMenu.LeftMouseClickEvent += SelectResult; pnlContextMenu.LeftMouseClickEvent += SelectResult;
pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent; pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent;
Closing += MainWindow_Closing;
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language);
SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey); SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey);
SetCustomPluginHotkey(); SetCustomPluginHotkey();
InitialTray(); InitialTray();
Closing += MainWindow_Closing;
} }
void pnlResult_ItemDropEvent(Result result, IDataObject dropDataObject, DragEventArgs args) void pnlResult_ItemDropEvent(Result result, IDataObject dropDataObject, DragEventArgs args)
@@ -250,6 +247,9 @@ namespace Wox
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
{ {
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language);
Left = GetWindowsLeft(); Left = GetWindowsLeft();
Top = GetWindowsTop(); Top = GetWindowsTop();

View File

@@ -1,23 +1,9 @@
using System.Reflection; using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
[assembly: AssemblyTitle("Wox")] [assembly: AssemblyTitle("Wox")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo( [assembly: ThemeInfo(
ResourceDictionaryLocation.None, ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly ResourceDictionaryLocation.SourceAssembly
)] )]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: Exceptionless.Configuration.Exceptionless("e0b256fbe9384498ba89aae2a6b7f8ab")] [assembly: Exceptionless.Configuration.Exceptionless("e0b256fbe9384498ba89aae2a6b7f8ab")]

View File

@@ -440,9 +440,7 @@ namespace Wox
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
string themeName = themeComboBox.SelectedItem.ToString(); string themeName = themeComboBox.SelectedItem.ToString();
UserSettingStorage.Instance.Theme = themeName; ThemeManager.Theme.ChangeTheme(themeName);
DelayChangeTheme();
UserSettingStorage.Instance.Save();
} }
private void CbQueryBoxFont_OnSelectionChanged(object sender, SelectionChangedEventArgs e) private void CbQueryBoxFont_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -451,16 +449,8 @@ namespace Wox
string queryBoxFontName = cbQueryBoxFont.SelectedItem.ToString(); string queryBoxFontName = cbQueryBoxFont.SelectedItem.ToString();
UserSettingStorage.Instance.QueryBoxFont = queryBoxFontName; UserSettingStorage.Instance.QueryBoxFont = queryBoxFontName;
this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface(); this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface();
DelayChangeTheme();
UserSettingStorage.Instance.Save(); UserSettingStorage.Instance.Save();
} ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
private void DelayChangeTheme()
{
Dispatcher.DelayInvoke("delayChangeTheme", () =>
{
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
}, TimeSpan.FromMilliseconds(100));
} }
private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e) private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -480,7 +470,7 @@ namespace Wox
UserSettingStorage.Instance.QueryBoxFontWeight = typeface.Weight.ToString(); UserSettingStorage.Instance.QueryBoxFontWeight = typeface.Weight.ToString();
UserSettingStorage.Instance.QueryBoxFontStyle = typeface.Style.ToString(); UserSettingStorage.Instance.QueryBoxFontStyle = typeface.Style.ToString();
UserSettingStorage.Instance.Save(); UserSettingStorage.Instance.Save();
DelayChangeTheme(); ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
} }
} }
@@ -490,9 +480,8 @@ namespace Wox
string resultItemFont = cbResultItemFont.SelectedItem.ToString(); string resultItemFont = cbResultItemFont.SelectedItem.ToString();
UserSettingStorage.Instance.ResultItemFont = resultItemFont; UserSettingStorage.Instance.ResultItemFont = resultItemFont;
this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface(); this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface();
UserSettingStorage.Instance.Save(); UserSettingStorage.Instance.Save();
DelayChangeTheme(); ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
} }
private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e) private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -510,7 +499,7 @@ namespace Wox
UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString(); UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString();
UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString(); UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString();
UserSettingStorage.Instance.Save(); UserSettingStorage.Instance.Save();
DelayChangeTheme(); ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
} }
} }

58
Wox/Themes/BlurBlack.xaml Normal file
View File

@@ -0,0 +1,58 @@
<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.MergedDictionaries>
<ResourceDictionary Source="Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<system:Boolean x:Key="ThemeBlurEnabled">True</system:Boolean>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FFFFFFFF" />
<Setter Property="Background" Value="#01000001" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Black" Opacity="0.3"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Black" Opacity="0.3"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
</Style>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="0, -10"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Margin" Value="0, -10"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Color x:Key="ItemSelectedBackgroundColor">#356ef3</Color>
<!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
</Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="#a0a0a0"/>
</Style>
</ResourceDictionary>

58
Wox/Themes/BlurWhite.xaml Normal file
View File

@@ -0,0 +1,58 @@
<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.MergedDictionaries>
<ResourceDictionary Source="Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<system:Boolean x:Key="ThemeBlurEnabled">True</system:Boolean>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF000000" />
<Setter Property="Background" Value="#01FFFFFF" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.1"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.1"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
</Style>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="0, -10"/>
<Setter Property="Foreground" Value="#FF000000"/>
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#FF000000"/>
</Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Margin" Value="0, -10"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#FFFFFFFF"/>
</Style>
<Color x:Key="ItemSelectedBackgroundColor">#356ef3</Color>
<!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
</Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="#a0a0a0"/>
</Style>
</ResourceDictionary>

View File

@@ -14,6 +14,8 @@
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}"> <Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
</Style> </Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}"> <Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
</Style> </Style>

View File

@@ -76,8 +76,8 @@
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath> <HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NHotkey, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="NHotkey, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
@@ -114,6 +114,9 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CommandArgs\ToggleCommandArg.cs" /> <Compile Include="CommandArgs\ToggleCommandArg.cs" />
<Compile Include="Converters\ConvertorBase.cs" /> <Compile Include="Converters\ConvertorBase.cs" />
<Compile Include="Converters\ImagePathConverter.cs" /> <Compile Include="Converters\ImagePathConverter.cs" />
@@ -217,6 +220,11 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Languages\fr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="MainWindow.xaml"> <Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -272,6 +280,16 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<Page Include="Themes\BlurBlack.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Page>
<Page Include="Themes\BlurWhite.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Page>
<Page Include="WoxUpdate.xaml"> <Page Include="WoxUpdate.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

View File

@@ -3,7 +3,7 @@
<package id="Exceptionless" version="1.5.2121" targetFramework="net452" /> <package id="Exceptionless" version="1.5.2121" targetFramework="net452" />
<package id="InputSimulator" version="1.0.4.0" targetFramework="net452" /> <package id="InputSimulator" version="1.0.4.0" targetFramework="net452" />
<package id="MarkdownSharp" version="1.13.0.0" targetFramework="net452" /> <package id="MarkdownSharp" version="1.13.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="NHotkey" version="1.2.1" targetFramework="net452" /> <package id="NHotkey" version="1.2.1" targetFramework="net452" />
<package id="NHotkey.Wpf" version="1.2.1" targetFramework="net452" /> <package id="NHotkey.Wpf" version="1.2.1" targetFramework="net452" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" /> <package id="SharpZipLib" version="0.86.0" targetFramework="net452" />

View File

@@ -1,4 +1,4 @@
version: 1.2.0.{build} version: 1.2.{build}
os: Visual Studio 2015 os: Visual Studio 2015
configuration: Release configuration: Release
platform: Any CPU platform: Any CPU
@@ -7,7 +7,7 @@ assembly_info:
file: AssemblyInfo.* file: AssemblyInfo.*
assembly_version: '{version}' assembly_version: '{version}'
assembly_file_version: '{version}' assembly_file_version: '{version}'
assembly_informational_version: '{version}-$(APPVEYOR_REPO_COMMIT)' assembly_informational_version: '{version}-beta.2-$(APPVEYOR_REPO_COMMIT)'
before_build: before_build:
- ps: nuget restore - ps: nuget restore
build: build: