Merge branch 'json-rpc'

This commit is contained in:
qianlifeng
2014-07-14 22:28:54 +08:00
1123 changed files with 326363 additions and 15366 deletions

View File

@@ -59,7 +59,7 @@ namespace Wox.Plugin.SystemPlugins.CMD
}
catch (Exception) { }
context.PushResults(query, new List<Result>() { result });
context.API.PushResults(query,context.CurrentPluginMetadata, new List<Result>() { result });
pushedResults.Add(result);
IEnumerable<Result> history = CMDStorage.Instance.CMDHistory.Where(o => o.Key.Contains(cmd))
@@ -95,7 +95,7 @@ namespace Wox.Plugin.SystemPlugins.CMD
return ret;
}).Where(o => o != null).Take(4);
context.PushResults(query, history.ToList());
context.API.PushResults(query,context.CurrentPluginMetadata,history.ToList());
pushedResults.AddRange(history);
try

View File

@@ -11,11 +11,13 @@ namespace Wox.Plugin.SystemPlugins
public class ThirdpartyPluginIndicator : BaseSystemPlugin
{
private List<PluginPair> allPlugins = new List<PluginPair>();
private Action<string> changeQuery;
private PluginInitContext context;
protected override List<Result> QueryInternal(Query query)
{
List<Result> results = new List<Result>();
if(allPlugins.Count == 0) allPlugins = context.API.GetAllPlugins();
foreach (PluginMetadata metadata in allPlugins.Select(o => o.Metadata))
{
@@ -36,7 +38,7 @@ namespace Wox.Plugin.SystemPlugins
IcoPath = "Images/work.png",
Action = (c) =>
{
changeQuery(metadataCopy.ActionKeyword + " ");
context.ChangeQuery(metadataCopy.ActionKeyword + " ");
return false;
},
};
@@ -52,7 +54,7 @@ namespace Wox.Plugin.SystemPlugins
IcoPath = "Images/work.png",
Action = (c) =>
{
changeQuery(n.ActionWord + " ");
context.ChangeQuery(n.ActionWord + " ");
return false;
}
}));
@@ -62,8 +64,7 @@ namespace Wox.Plugin.SystemPlugins
protected override void InitInternal(PluginInitContext context)
{
allPlugins = context.Plugins;
changeQuery = context.ChangeQuery;
this.context = context;
}

View File

@@ -22,7 +22,7 @@ namespace Wox.Plugin.SystemPlugins
Score = 8,
Action = _ =>
{
Process.Start(raw);
Process.Start(uri.AbsoluteUri);
return true;
}
}

View File

@@ -32,7 +32,7 @@ namespace Wox.Plugin.SystemPlugins
title = subtitle;
subtitle = null;
}
context.PushResults(query, new List<Result>()
context.API.PushResults(query,context.CurrentPluginMetadata, new List<Result>()
{
new Result()
{
@@ -54,7 +54,7 @@ namespace Wox.Plugin.SystemPlugins
var result = sugg.GetSuggestions(keyword);
if (result != null)
{
context.PushResults(query, result.Select(o => new Result()
context.API.PushResults(query,context.CurrentPluginMetadata, result.Select(o => new Result()
{
Title = o,
SubTitle = subtitle,