Cleanup of plugin names and made sure the plugin writer gets credit for his work.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1728 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-03-31 20:18:17 +00:00
commit 9a6bc91c00
14 changed files with 60 additions and 33 deletions

View file

@ -29,11 +29,15 @@ using GreenshotPlugin.Core;
namespace Greenshot.Plugin {
[Serializable]
[AttributeUsageAttribute(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
sealed public class PluginAttribute : Attribute {
sealed public class PluginAttribute : Attribute, IComparable {
public string Name {
get;
set;
}
public string CreatedBy {
get;
set;
}
public string Version {
get;
set;
@ -56,6 +60,14 @@ namespace Greenshot.Plugin {
this.EntryType = entryType;
this.Configurable = configurable;
}
public int CompareTo(object obj) {
PluginAttribute other = obj as PluginAttribute;
if (other != null) {
return Name.CompareTo(other.Name);
}
throw new ArgumentException("object is not a PluginAttribute");
}
}
// Delegates for hooking up events.
@ -118,7 +130,7 @@ namespace Greenshot.Plugin {
/// List of available plugins with their PluginAttributes
/// This can be usefull for a plugin manager plugin...
/// </summary>
Dictionary<PluginAttribute, IGreenshotPlugin> Plugins {
IDictionary<PluginAttribute, IGreenshotPlugin> Plugins {
get;
}