我有一个 BindingSource 的子类,它只是为了满足我们的特殊需要而对其进行了一些扩展,我想为 VS2008 Designer 支持它。
我有三个属性,我想获得设计师的支持,其中两个应该Control
在表单上设置为 other s,一个应该设置为 a Type
。
在 den Designer 中显示它们以及设置默认值 null 非常容易,但是我如何设法让 VS 选择可用的 Controls (理想情况下只有所需的类型)和或Type
s ?
这是到目前为止的属性代码,欢迎任何提示,因为我对 VS-Designer 支持一无所知。
public class BindingSourceEx
: BindingSource
{
[DisplayName("DataSourceType")]
[Description("Sets the type to bind to.")]
public Type DataSourceType
{
get;
set;
}
[DisplayName("BindingNavigator")]
[DefaultValue(null)]
[Description("Sets the BindingNavigatorQ1 to use.")]
public BindingNavigatorEx BindingNavigator
{
get;
set;
}
[DisplayName("DataGridView")]
[DefaultValue(null)]
[Description("Sets the DataGridViewQ1 to use.")]
public DataGridViewEx DataGridView
{
get;
set;
}
}