PowerToys/Wox.Plugin.SystemPlugins/BaseSystemPlugin.cs

24 lines
744 B
C#
Raw Normal View History

2014-05-21 12:53:32 +08:00
using System.Collections.Generic;
2014-01-15 22:45:02 +08:00
2014-05-21 12:53:32 +08:00
namespace Wox.Plugin.SystemPlugins {
2014-01-15 22:45:02 +08:00
2014-05-21 12:53:32 +08:00
public abstract class BaseSystemPlugin : ISystemPlugin {
public string PluginDirectory { get; set; }
public virtual string Name { get { return "System workflow"; } }
public virtual string Description { get { return "System workflow"; } }
public virtual string IcoPath { get { return null; } }
2014-01-15 22:45:02 +08:00
2014-05-21 12:53:32 +08:00
protected abstract List<Result> QueryInternal(Query query);
2014-01-15 22:45:02 +08:00
2014-05-21 12:53:32 +08:00
protected abstract void InitInternal(PluginInitContext context);
2014-01-15 22:45:02 +08:00
2014-05-21 12:53:32 +08:00
public List<Result> Query(Query query) {
if (string.IsNullOrEmpty(query.RawQuery)) return new List<Result>();
return QueryInternal(query);
}
2014-05-21 12:53:32 +08:00
public void Init(PluginInitContext context) {
InitInternal(context);
}
}
}