我使用紧凑框架3.5和Pocket PC 2003平台。C#和CF:设计时间属性
我在写我的应用程序自定义控制。我希望将某些属性作为设计时属性公开。
它在MSDN描述(http://msdn.microsoft.com/en-us/library/tk67c2t8.aspx)的方式是不实际工作。
我得到:
类型或命名空间名称“的CategoryAttribute”找不到(是否缺少using指令或程序集引用
我使用智能感知看? 。什么属性我可以写它列出像一些奇怪的事情:
- EditorBrowsable
- 德signerCategory
- 默认值
- DesignTimeVisible
还有更多。如果我尝试使用这些这样:
public partial class Counter : UserControl
{
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerCategory("Data")]
[DesignTimeVisible(true)]
[DefaultValue(0)]
public UInt64 theNumber;
..我得到以下错误:
属性“DesignerCategory”不是 在此声明类型有效。这是 仅适用于“类”的声明。
属性'DesignTimeVisible'不是 对此声明类型有效。它是 只对'class,interface' 声明有效。
什么是使用设计时间属性的正确方法?