I’ve created my own plugin architecture based on the common practices but I’m stuck with icons.
First of all my plugins define Clients to be used by the host and each Client is defined with attributes like:
[Client("Heroes of Newerth", "Heroes of Newerth Chat Client", "hon_16.png")]
With this my host application can read the plugin/client's metainfo without actually creating an instance of it but I’m stuck with the icon part.
As in the above example a client can pass a bitmap file name and in my attributes implementation I can handle it like this:
[AttributeUsage(AttributeTargets.Class)]
public class ClientAttribute : Attribute
{
private string _name;
private string _description;
private Bitmap _icon;
public string Name { get { return this._name; } }
public string Description { get { return this._description; } }
public Bitmap Icon { get { return this._icon; } }
public ClientAttribute(string Name, string Description, string IconFile = null)
{
this._name = Name;
this._description = Description;
this._icon = new Bitmap(IconFile);
}
}
The problem is that within this method I need to publish the icon files with my release as is and can't add them to resources. I'll be happy to hear a method that I can still embed the icons in resources.