문제

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.?

도움이 되었습니까?

해결책

I've always used the standard built-in Winforms PropertyGrid. It works well for different types of properties and for varying numbers as well.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top