开发者

Why is the UITypeEditor "DateTimeEditor" not visible in the object browser?

开发者 https://www.devze.com 2023-01-17 01:56 出处:网络
I\'开发者_JAVA百科m writing a custom control (using VS2010 & C#) and it has a property which is a nullable datetime.

I'开发者_JAVA百科m writing a custom control (using VS2010 & C#) and it has a property which is a nullable datetime.

Why is it that, when defining my property, I can write this...

[Editor("System.ComponentModel.Design.DateTimeEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public DateTime? When
{
    :
}

...but not this...

[Editor(typeof(System.ComponentModel.Design.DateTimeEditor), typeof(UITypeEditor))]
public DateTime? When
{
    :
}

Why is the DateTimeEditor not visible in the object browser (for example) ?

Thanks, Ross


You have to add a reference to System.Design for the DatetimeEditor to be visibile in Object Browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消