2013-12-19 23:51:20 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace WinAlfred.Plugin.Everything
|
|
|
|
|
{
|
|
|
|
|
public class Main : IPlugin
|
|
|
|
|
{
|
|
|
|
|
EverythingAPI api = new EverythingAPI();
|
|
|
|
|
|
|
|
|
|
public List<Result> Query(Query query)
|
|
|
|
|
{
|
|
|
|
|
var results = new List<Result>();
|
2013-12-21 01:20:17 +08:00
|
|
|
|
if (query.ActionParameters.Count > 0 && query.ActionParameters[0].Length > 0)
|
2013-12-19 23:51:20 +08:00
|
|
|
|
{
|
2013-12-21 01:20:17 +08:00
|
|
|
|
IEnumerable<string> enumerable = api.Search(query.ActionParameters[0]);
|
|
|
|
|
foreach (string s in enumerable)
|
|
|
|
|
{
|
|
|
|
|
Result r = new Result();
|
|
|
|
|
r.Title = s;
|
|
|
|
|
results.Add(r);
|
|
|
|
|
}
|
2013-12-19 23:51:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return results;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
|
|
|
|
//init everything
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|