MVVM refactoring for web search plugin, part 1

1. #486
2. fix #778 #763 #742
3. MVVM refactoring
4. remove IMultipleActionKeywords interface, use PluginManager directly
This commit is contained in:
bao-qian
2016-06-21 00:14:32 +01:00
parent 3efeb4a0a6
commit 6e13440f1f
30 changed files with 495 additions and 518 deletions

View File

@@ -12,8 +12,7 @@ namespace Wox.Plugin.WebSearch.SuggestionSources
{
public class Google : SuggestionSource
{
public override string Domain { get; set; } = "www.google.com";
public override async Task<List<string>> GetSuggestions(string query)
public override async Task<List<string>> Suggestions(string query)
{
string result;
try
@@ -25,7 +24,8 @@ namespace Wox.Plugin.WebSearch.SuggestionSources
{
Log.Warn("Can't get suggestion from google");
Log.Exception(e);
return new List<string>(); ;
return new List<string>();
;
}
if (string.IsNullOrEmpty(result)) return new List<string>();
JContainer json;
@@ -48,5 +48,10 @@ namespace Wox.Plugin.WebSearch.SuggestionSources
}
return new List<string>();
}
public override string ToString()
{
return "Google";
}
}
}
}