mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Allow searches in context menu
This commit is contained in:
@@ -11,13 +11,13 @@ namespace Wox.Plugin.Everything
|
||||
{
|
||||
public class ContextMenuStorage : JsonStrorage<ContextMenuStorage>
|
||||
{
|
||||
[JsonProperty]
|
||||
public List<ContextMenu> ContextMenus = new List<ContextMenu>();
|
||||
|
||||
[JsonProperty] public List<ContextMenu> ContextMenus = new List<ContextMenu>();
|
||||
|
||||
[JsonProperty]
|
||||
public int MaxSearchCount { get; set; }
|
||||
|
||||
public IPublicAPI API { get; set; }
|
||||
|
||||
protected override string ConfigName
|
||||
{
|
||||
get { return "EverythingContextMenu"; }
|
||||
@@ -28,20 +28,14 @@ namespace Wox.Plugin.Everything
|
||||
get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); }
|
||||
}
|
||||
|
||||
protected override void OnAfterLoad(ContextMenuStorage obj)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override ContextMenuStorage LoadDefault()
|
||||
{
|
||||
ContextMenus = new List<ContextMenu>()
|
||||
{
|
||||
new ContextMenu()
|
||||
{
|
||||
Name = "Open Containing Folder",
|
||||
Command = "explorer.exe",
|
||||
Argument = " /select,\"{path}\"",
|
||||
ImagePath ="Images\\folder.png"
|
||||
}
|
||||
};
|
||||
MaxSearchCount = 100;
|
||||
Save();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -60,4 +54,4 @@ namespace Wox.Plugin.Everything
|
||||
[JsonProperty]
|
||||
public string ImagePath { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Plugins/Wox.Plugin.Everything/Languages/en.xaml
Normal file
11
Plugins/Wox.Plugin.Everything/Languages/en.xaml
Normal file
@@ -0,0 +1,11 @@
|
||||
<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">
|
||||
|
||||
<system:String x:Key="wox_plugin_everything_is_not_running">Everything is not runnin</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_query_error">Everything plugin has an error (enter to copy error message)</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_copied">Copied</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_canot_start">Can't start {0}</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_open_containing_folder">Open containing folder</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
11
Plugins/Wox.Plugin.Everything/Languages/zh-cn.xaml
Normal file
11
Plugins/Wox.Plugin.Everything/Languages/zh-cn.xaml
Normal file
@@ -0,0 +1,11 @@
|
||||
<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">
|
||||
|
||||
<system:String x:Key="wox_plugin_everything_is_not_running">Everything没有运行,我们将自动为您启动内置Everything,请稍后进行查询</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_query_error">Everything插件发生了一个错误(回车拷贝具体错误信息)</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_copied">拷贝成功</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_canot_start">不能启动 {0}</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_open_containing_folder">打开所属文件夹</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
11
Plugins/Wox.Plugin.Everything/Languages/zh-tw.xaml
Normal file
11
Plugins/Wox.Plugin.Everything/Languages/zh-tw.xaml
Normal file
@@ -0,0 +1,11 @@
|
||||
<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">
|
||||
|
||||
<system:String x:Key="wox_plugin_everything_is_not_running">Everything沒有運行,我們將自動為您啟動內置Everything,請稍後進行查詢</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_query_error">Everything插件發生了一個錯誤(回車拷貝具體錯誤信息)</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_copied">拷貝成功</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_canot_start">不能啟動 {0}</system:String>
|
||||
<system:String x:Key="wox_plugin_everything_open_containing_folder">打開所屬文件夾</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -9,7 +9,7 @@ using Wox.Plugin.Everything.Everything;
|
||||
|
||||
namespace Wox.Plugin.Everything
|
||||
{
|
||||
public class Main : IPlugin
|
||||
public class Main : IPlugin, IPluginI18n
|
||||
{
|
||||
PluginInitContext context;
|
||||
EverythingAPI api = new EverythingAPI();
|
||||
@@ -59,7 +59,7 @@ namespace Wox.Plugin.Everything
|
||||
StartEverything();
|
||||
results.Add(new Result()
|
||||
{
|
||||
Title = "Everything is not running, we already run it for you now. Try search again",
|
||||
Title = context.API.GetTranslation("wox_plugin_everything_is_not_running"),
|
||||
IcoPath = "Images\\warning.png"
|
||||
});
|
||||
}
|
||||
@@ -67,12 +67,12 @@ namespace Wox.Plugin.Everything
|
||||
{
|
||||
results.Add(new Result()
|
||||
{
|
||||
Title = "Everything plugin has an error (enter to copy error message)",
|
||||
Title = context.API.GetTranslation("wox_plugin_everything_query_error"),
|
||||
SubTitle = e.Message,
|
||||
Action = _ =>
|
||||
{
|
||||
System.Windows.Clipboard.SetText(e.Message + "\r\n" + e.StackTrace);
|
||||
context.API.ShowMsg("Copied", "Error message has copied to your clipboard", string.Empty);
|
||||
context.API.ShowMsg(context.API.GetTranslation("wox_plugin_everything_copied"), null, string.Empty);
|
||||
return false;
|
||||
},
|
||||
IcoPath = "Images\\error.png"
|
||||
@@ -114,9 +114,13 @@ namespace Wox.Plugin.Everything
|
||||
{
|
||||
List<Result> contextMenus = new List<Result>();
|
||||
|
||||
List<ContextMenu> availableContextMenus = new List<ContextMenu>();
|
||||
availableContextMenus.AddRange(GetDefaultContextMenu());
|
||||
availableContextMenus.AddRange(ContextMenuStorage.Instance.ContextMenus);
|
||||
|
||||
if (record.Type == ResultType.File)
|
||||
{
|
||||
foreach (ContextMenu contextMenu in ContextMenuStorage.Instance.ContextMenus)
|
||||
foreach (ContextMenu contextMenu in availableContextMenus)
|
||||
{
|
||||
contextMenus.Add(new Result()
|
||||
{
|
||||
@@ -126,11 +130,11 @@ namespace Wox.Plugin.Everything
|
||||
string argument = contextMenu.Argument.Replace("{path}", record.FullPath);
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(contextMenu.Command, argument);
|
||||
Process.Start(contextMenu.Command, argument);
|
||||
}
|
||||
catch
|
||||
{
|
||||
context.API.ShowMsg("Can't start " + record.FullPath, string.Empty, string.Empty);
|
||||
context.API.ShowMsg(string.Format(context.API.GetTranslation("wox_plugin_everything_canot_start"), record.FullPath), string.Empty, string.Empty);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -143,9 +147,25 @@ namespace Wox.Plugin.Everything
|
||||
return contextMenus;
|
||||
}
|
||||
|
||||
private List<ContextMenu> GetDefaultContextMenu()
|
||||
{
|
||||
List<ContextMenu> defaultContextMenus = new List<ContextMenu>();
|
||||
ContextMenu openFolderContextMenu = new ContextMenu()
|
||||
{
|
||||
Name = context.API.GetTranslation("wox_plugin_everything_open_containing_folder"),
|
||||
Command = "explorer.exe",
|
||||
Argument = " /select,\"{path}\"",
|
||||
ImagePath = "Images\\folder.png"
|
||||
};
|
||||
|
||||
defaultContextMenus.Add(openFolderContextMenu);
|
||||
return defaultContextMenus;
|
||||
}
|
||||
|
||||
public void Init(PluginInitContext context)
|
||||
{
|
||||
this.context = context;
|
||||
ContextMenuStorage.Instance.API = context.API;
|
||||
|
||||
LoadLibrary(Path.Combine(
|
||||
Path.Combine(context.CurrentPluginMetadata.PluginDirectory, (IntPtr.Size == 4) ? "x86" : "x64"),
|
||||
@@ -159,12 +179,20 @@ namespace Wox.Plugin.Everything
|
||||
{
|
||||
if (!CheckEverythingIsRunning())
|
||||
{
|
||||
Process p = new Process();
|
||||
p.StartInfo.Verb = "runas";
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.StartInfo.FileName = GetEverythingPath();
|
||||
p.StartInfo.UseShellExecute = true;
|
||||
p.Start();
|
||||
try
|
||||
{
|
||||
Process p = new Process();
|
||||
p.StartInfo.Verb = "runas";
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.StartInfo.FileName = GetEverythingPath();
|
||||
p.StartInfo.UseShellExecute = true;
|
||||
p.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
context.API.ShowMsg("Start Everything failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,5 +206,10 @@ namespace Wox.Plugin.Everything
|
||||
string everythingFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "PortableEverything");
|
||||
return Path.Combine(everythingFolder, "Everything.exe");
|
||||
}
|
||||
|
||||
public string GetLanguagesFolder()
|
||||
{
|
||||
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,130 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{230AE83F-E92E-4E69-8355-426B305DA9C0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Everything</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Everything</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\Wox\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Everything\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Output\Release\Plugins\Wox.Plugin.Everything\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Everything\Exceptions\CreateThreadException.cs" />
|
||||
<Compile Include="Everything\Exceptions\CreateWindowException.cs" />
|
||||
<Compile Include="Everything\EverythingAPI.cs" />
|
||||
<Compile Include="Everything\Exceptions\MemoryErrorException.cs" />
|
||||
<Compile Include="Everything\Exceptions\InvalidCallException.cs" />
|
||||
<Compile Include="Everything\Exceptions\InvalidIndexException.cs" />
|
||||
<Compile Include="Everything\Exceptions\IPCErrorException.cs" />
|
||||
<Compile Include="Everything\Exceptions\RegisterClassExException.cs" />
|
||||
<Compile Include="Everything\ResultType.cs" />
|
||||
<Compile Include="Everything\SearchResult.cs" />
|
||||
<Compile Include="ContextMenuStorage.cs" />
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\error.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\file.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\find.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\folder.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\image.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\warning.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="packages.config" />
|
||||
<None Include="PortableEverything\Everything.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Content Include="x64\Everything.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="x86\Everything.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{230AE83F-E92E-4E69-8355-426B305DA9C0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Wox.Plugin.Everything</RootNamespace>
|
||||
<AssemblyName>Wox.Plugin.Everything</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\Wox\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\Wox.Plugin.Everything\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Output\Release\Plugins\Wox.Plugin.Everything\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Everything\Exceptions\CreateThreadException.cs" />
|
||||
<Compile Include="Everything\Exceptions\CreateWindowException.cs" />
|
||||
<Compile Include="Everything\EverythingAPI.cs" />
|
||||
<Compile Include="Everything\Exceptions\MemoryErrorException.cs" />
|
||||
<Compile Include="Everything\Exceptions\InvalidCallException.cs" />
|
||||
<Compile Include="Everything\Exceptions\InvalidIndexException.cs" />
|
||||
<Compile Include="Everything\Exceptions\IPCErrorException.cs" />
|
||||
<Compile Include="Everything\Exceptions\RegisterClassExException.cs" />
|
||||
<Compile Include="Everything\ResultType.cs" />
|
||||
<Compile Include="Everything\SearchResult.cs" />
|
||||
<Compile Include="ContextMenuStorage.cs" />
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\error.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\file.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\find.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\folder.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\image.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\warning.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="packages.config" />
|
||||
<None Include="PortableEverything\Everything.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Content Include="x64\Everything.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="x86\Everything.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="plugin.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
|
||||
<Name>Wox.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
|
||||
<Name>Wox.Plugin</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Languages\en.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Languages\zh-cn.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Languages\zh-tw.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
-->
|
||||
</Project>
|
||||
@@ -19,5 +19,8 @@
|
||||
<system:String x:Key="wox_plugin_program_split_by_tip">(Each suffix should split by ;)</system:String>
|
||||
<system:String x:Key="wox_plugin_program_update_file_suffixes">Sucessfully update file suffixes</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes_cannot_empty">File suffixes can't be empty</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_run_as_administrator">Run As Administrator</system:String>
|
||||
<system:String x:Key="wox_plugin_program_open_containing_folder">Open containing folder</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,24 +1,27 @@
|
||||
<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">
|
||||
|
||||
<!--Program setting-->
|
||||
<system:String x:Key="wox_plugin_program_delete">删除</system:String>
|
||||
<system:String x:Key="wox_plugin_program_edit">编辑</system:String>
|
||||
<system:String x:Key="wox_plugin_program_add">增加</system:String>
|
||||
<system:String x:Key="wox_plugin_program_location">位置</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes">索引文件后缀</system:String>
|
||||
<system:String x:Key="wox_plugin_program_reindex">重新索引</system:String>
|
||||
<system:String x:Key="wox_plugin_program_indexing">索引中</system:String>
|
||||
|
||||
|
||||
<system:String x:Key="wox_plugin_program_pls_select_program_source">请先选择一项</system:String>
|
||||
<system:String x:Key="wox_plugin_program_delete_program_source">你确定要删除{0}吗?</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_update">更新</system:String>
|
||||
<system:String x:Key="wox_plugin_program_only_index_tip">Wox仅索引下列后缀的文件:</system:String>
|
||||
<system:String x:Key="wox_plugin_program_split_by_tip">(每个后缀以英文状态下的分号分隔)</system:String>
|
||||
<system:String x:Key="wox_plugin_program_update_file_suffixes">成功更新索引文件后缀</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes_cannot_empty">文件后缀不能为空</system:String>
|
||||
|
||||
<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">
|
||||
|
||||
<!--Program setting-->
|
||||
<system:String x:Key="wox_plugin_program_delete">删除</system:String>
|
||||
<system:String x:Key="wox_plugin_program_edit">编辑</system:String>
|
||||
<system:String x:Key="wox_plugin_program_add">增加</system:String>
|
||||
<system:String x:Key="wox_plugin_program_location">位置</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes">索引文件后缀</system:String>
|
||||
<system:String x:Key="wox_plugin_program_reindex">重新索引</system:String>
|
||||
<system:String x:Key="wox_plugin_program_indexing">索引中</system:String>
|
||||
|
||||
|
||||
<system:String x:Key="wox_plugin_program_pls_select_program_source">请先选择一项</system:String>
|
||||
<system:String x:Key="wox_plugin_program_delete_program_source">你确定要删除{0}吗?</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_update">更新</system:String>
|
||||
<system:String x:Key="wox_plugin_program_only_index_tip">Wox仅索引下列后缀的文件:</system:String>
|
||||
<system:String x:Key="wox_plugin_program_split_by_tip">(每个后缀以英文状态下的分号分隔)</system:String>
|
||||
<system:String x:Key="wox_plugin_program_update_file_suffixes">成功更新索引文件后缀</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes_cannot_empty">文件后缀不能为空</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_run_as_administrator">以管理员身份运行</system:String>
|
||||
<system:String x:Key="wox_plugin_program_open_containing_folder">打开所属文件夹</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,24 +1,26 @@
|
||||
<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">
|
||||
|
||||
<!--Program setting-->
|
||||
<system:String x:Key="wox_plugin_program_delete">刪除</system:String>
|
||||
<system:String x:Key="wox_plugin_program_edit">編輯</system:String>
|
||||
<system:String x:Key="wox_plugin_program_add">增加</system:String>
|
||||
<system:String x:Key="wox_plugin_program_location">位置</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes">索引文件後綴</system:String>
|
||||
<system:String x:Key="wox_plugin_program_reindex">重新索引</system:String>
|
||||
<system:String x:Key="wox_plugin_program_indexing">索引中</system:String>
|
||||
|
||||
|
||||
<system:String x:Key="wox_plugin_program_pls_select_program_source">請先選擇一項</system:String>
|
||||
<system:String x:Key="wox_plugin_program_delete_program_source">你確定要刪除{0}嗎?</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_update">更新</system:String>
|
||||
<system:String x:Key="wox_plugin_program_only_index_tip">Wox僅索引下列後綴的文件:</system:String>
|
||||
<system:String x:Key="wox_plugin_program_split_by_tip">(每個後綴以英文狀態下的分號分隔)</system:String>
|
||||
<system:String x:Key="wox_plugin_program_update_file_suffixes">成功更新索引文件後綴</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes_cannot_empty">文件後綴不能為空</system:String>
|
||||
|
||||
<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">
|
||||
|
||||
<!--Program setting-->
|
||||
<system:String x:Key="wox_plugin_program_delete">刪除</system:String>
|
||||
<system:String x:Key="wox_plugin_program_edit">編輯</system:String>
|
||||
<system:String x:Key="wox_plugin_program_add">增加</system:String>
|
||||
<system:String x:Key="wox_plugin_program_location">位置</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes">索引文件後綴</system:String>
|
||||
<system:String x:Key="wox_plugin_program_reindex">重新索引</system:String>
|
||||
<system:String x:Key="wox_plugin_program_indexing">索引中</system:String>
|
||||
|
||||
|
||||
<system:String x:Key="wox_plugin_program_pls_select_program_source">請先選擇一項</system:String>
|
||||
<system:String x:Key="wox_plugin_program_delete_program_source">你確定要刪除{0}嗎?</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_update">更新</system:String>
|
||||
<system:String x:Key="wox_plugin_program_only_index_tip">Wox僅索引下列後綴的文件:</system:String>
|
||||
<system:String x:Key="wox_plugin_program_split_by_tip">(每個後綴以英文狀態下的分號分隔)</system:String>
|
||||
<system:String x:Key="wox_plugin_program_update_file_suffixes">成功更新索引文件後綴</system:String>
|
||||
<system:String x:Key="wox_plugin_program_suffixes_cannot_empty">文件後綴不能為空</system:String>
|
||||
|
||||
<system:String x:Key="wox_plugin_program_run_as_administrator">以管理員身份運行</system:String>
|
||||
<system:String x:Key="wox_plugin_program_open_containing_folder">打開所屬文件夾</system:String>
|
||||
</ResourceDictionary>
|
||||
@@ -48,7 +48,7 @@ namespace Wox.Plugin.Program
|
||||
{
|
||||
new Result()
|
||||
{
|
||||
Title = "Run As Administrator",
|
||||
Title = context.API.GetTranslation("wox_plugin_program_run_as_administrator"),
|
||||
Action = _ =>
|
||||
{
|
||||
context.API.HideApp();
|
||||
@@ -59,7 +59,7 @@ namespace Wox.Plugin.Program
|
||||
},
|
||||
new Result()
|
||||
{
|
||||
Title = "Open Containing Folder",
|
||||
Title = context.API.GetTranslation("wox_plugin_program_open_containing_folder"),
|
||||
Action = _ =>
|
||||
{
|
||||
context.API.HideApp();
|
||||
@@ -85,8 +85,8 @@ namespace Wox.Plugin.Program
|
||||
static string ResolveShortcut(string filePath)
|
||||
{
|
||||
// IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model"
|
||||
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
|
||||
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath);
|
||||
WshShell shell = new WshShell();
|
||||
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(filePath);
|
||||
return shortcut.TargetPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user