Fix setting for multiple action keywords

1. completed rewrite the action keyword setting logic.
2. Fix setting for multiple action keywords in #352
3. Fix setting for Web Search plugin
This commit is contained in:
bao-qian
2015-11-09 03:20:02 +00:00
parent da5a930e89
commit 8aee2858ea
14 changed files with 1286 additions and 174 deletions

View File

@@ -38,4 +38,17 @@ namespace Wox.Plugin
string GetTranslatedPluginDescription();
}
public interface IMultipleActionKeywords
{
event ActionKeywordsChangedEventHandler ActionKeywordsChanged;
}
public class ActionKeywordsChangedEventArgs : EventArgs
{
public string OldActionKeyword { get; set; }
public string NewActionKeyword { get; set; }
}
public delegate void ActionKeywordsChangedEventHandler(IMultipleActionKeywords sender, ActionKeywordsChangedEventArgs e);
}

View File

@@ -15,5 +15,24 @@
{
return Metadata.Name;
}
public override bool Equals(object obj)
{
PluginPair r = obj as PluginPair;
if (r != null)
{
return string.Equals(r.Metadata.ID, Metadata.ID);
}
else
{
return false;
}
}
public override int GetHashCode()
{
var hashcode = Metadata.ID?.GetHashCode() ?? 0;
return hashcode;
}
}
}

View File

@@ -57,7 +57,8 @@ namespace Wox.Plugin
public override int GetHashCode()
{
return (Title?.GetHashCode() ?? 0) ^ (SubTitle?.GetHashCode() ?? 0);
var hashcode = (Title?.GetHashCode() ?? 0) ^ (SubTitle?.GetHashCode() ?? 0);
return hashcode;
}
public override string ToString()