How to represent "options" for my plugin architecture (C# .NET WinForms)

Posted by Joshua on Stack Overflow See other posts from Stack Overflow or by Joshua
Published on 2010-03-30T04:24:15Z Indexed on 2010/03/30 4:33 UTC
Read the original article Hit count: 613

Filed under:
|
|
|

Okay basically here's where I'm at.

I have a list of PropertyDescriptor objects. These describe the custom "Options" fields on my Plugins, aka:

public class MyPlugin : PluginAbstract, IPlugin
{
 [PluginOption("This controls the color of blah blah blah")]
 [DefaultValue(Color.Red)]
 public Color TheColor { get; set; }

 [PluginOption("The number of blah blah blahs")]
 [DefaultValue(10)]
 public int BlahBlahBlahs { get; set; }
}

So I did all the hard parts: I have all the descriptions, default values, names and types of these custom "plugin options".

MY QUESTION IS: When a user loads a plugin, how should I represent these options for them to config? On the back end I'll be using XML for the config, so that's not what I'm asking. I'm asking on the front end: What kind of WinForms control should I use to let users configure the options of a plugin, when there will be an unknown amount of options and different types used etc.?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET