저는 BindingSource의 Subclass를 가지고 있는데,이 클래스는 우리의 특별한 필요에 따라 약간 확장되었습니다. VS2008 Designer에서 지원하고 싶습니다.Winforms Designer에서 형식과 컨트롤을 선택하도록 지원합니다.
나는 디자이너 지원을 받고 싶습니다. 그 중 두 개는 다른 Control
으로 설정해야합니다. 하나는 Type
으로 설정해야합니다.
기본값으로 null을 설정하는 것뿐만 아니라 디자이너를 표시하는 것은 매우 쉽습니다. 그러나 VS에서 availlable 컨트롤 (이상적으로 원하는 유형에만 해당) 및 Type
을 선택하는 방법은 무엇입니까?
여기까지는 속성에 대한 코드가 있는데, 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;
}
}
이와 같은 TypeConverter에 대한 샘플 코드를 제공해 주시겠습니까? –
나는 치과 의사를 방문하는만큼 TypeConverters를 쓰고 싶다. 그것이 끝나면 그것은 재미있는 일입니다. 이 경우 특히 디자인 타임에 유형을 응원합니다. 그것은 잘 googles ... –