This commit is contained in:
qianlifeng
2015-01-28 10:16:10 +08:00
20 changed files with 184 additions and 100 deletions

View File

@@ -6,12 +6,13 @@ using System.Reflection;
using System.Windows.Forms;
using WindowsInput;
using WindowsInput.Native;
using Wox.Infrastructure;
using Wox.Infrastructure.Hotkey;
using Control = System.Windows.Controls.Control;
namespace Wox.Plugin.CMD
{
public class CMD : IPlugin, ISettingProvider, IPluginI18n
public class CMD : IPlugin, ISettingProvider, IPluginI18n, IInstantSearch
{
private PluginInitContext context;
private bool WinRStroked;
@@ -37,6 +38,7 @@ namespace Wox.Plugin.CMD
context.API.PushResults(query, context.CurrentPluginMetadata, history);
pushedResults.AddRange(history);
try
{
string basedir = null;
@@ -72,6 +74,7 @@ namespace Wox.Plugin.CMD
}
}
catch (Exception) { }
}
return results;
}
@@ -207,5 +210,11 @@ namespace Wox.Plugin.CMD
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
}
public bool IsInstantSearch(string query)
{
if (query.StartsWith(">")) return true;
return false;
}
}
}
}

View File

@@ -36,9 +36,9 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<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" />
@@ -82,6 +82,7 @@
<Content Include="Images\warning.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
<None Include="PortableEverything\Everything.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -93,7 +94,6 @@
</Content>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

Binary file not shown.

View File

@@ -9,7 +9,7 @@ using Wox.Plugin.WebSearch.SuggestionSources;
namespace Wox.Plugin.WebSearch
{
public class WebSearchPlugin : IPlugin, ISettingProvider,IPluginI18n
public class WebSearchPlugin : IPlugin, ISettingProvider, IPluginI18n, IInstantSearch
{
private PluginInitContext context;
@@ -97,5 +97,16 @@ namespace Wox.Plugin.WebSearch
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
}
public bool IsInstantSearch(string query)
{
var strings = query.Split(' ');
if (strings.Length > 1)
{
return WebSearchStorage.Instance.EnableWebSearchSuggestion &&
WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionWord == strings[0] && o.Enabled);
}
return false;
}
}
}