Cleaned FileSystemPlugin + Enhanced

THIS NEEDS TESTING!
This commit is contained in:
Aaron Campf
2014-05-09 18:24:16 -07:00
parent 498634fd13
commit 81467a86cc
9 changed files with 626 additions and 718 deletions

View File

@@ -2,47 +2,56 @@
using System.Collections;
using System.Collections.Generic;
namespace Wox.Plugin
{
public class Result
{
public string Title { get; set; }
public string SubTitle { get; set; }
public string IcoPath { get; set; }
namespace Wox.Plugin {
public class Result {
public string Title { get; set; }
public string SubTitle { get; set; }
public string IcoPath { get; set; }
/// <summary>
/// return true to hide wox after select result
/// </summary>
public Func<ActionContext,bool> Action { get; set; }
public int Score { get; set; }
/// <summary>
/// return true to hide wox after select result
/// </summary>
public Func<ActionContext, bool> Action { get; set; }
public int Score { get; set; }
/// <summary>
/// Auto add scores for MRU items
/// </summary>
public bool AutoAjustScore { get; set; }
/// <summary>
/// Auto add scores for MRU items
/// </summary>
public bool AutoAjustScore { get; set; }
//todo: this should be controlled by system, not visible to users
/// <summary>
/// Only resulsts that originQuery match with curren query will be displayed in the panel
/// </summary>
public Query OriginQuery { get; set; }
//todo: this should be controlled by system, not visible to users
/// <summary>
/// Only resulsts that originQuery match with curren query will be displayed in the panel
/// </summary>
public Query OriginQuery { get; set; }
/// <summary>
/// Don't set this property if you are developing a plugin
/// </summary>
public string PluginDirectory { get; set; }
/// <summary>
/// Don't set this property if you are developing a plugin
/// </summary>
public string PluginDirectory { get; set; }
public new bool Equals(object obj)
{
if (obj == null || !(obj is Result)) return false;
public new bool Equals(object obj) {
if (obj == null || !(obj is Result)) return false;
Result r = (Result)obj;
return r.Title == Title && r.SubTitle == SubTitle;
}
Result r = (Result)obj;
return r.Title == Title && r.SubTitle == SubTitle;
}
public override string ToString()
{
return Title + SubTitle;
}
}
public override string ToString() {
return Title + SubTitle;
}
public Result() {
}
public Result(string Title = null, string IcoPath = null, string SubTitle = null) {
this.Title = Title;
this.IcoPath = IcoPath;
this.SubTitle = SubTitle;
}
}
}