Tag: 物业

无效的Resx文件。 无法加载类型错误为什么?

我在代码上遇到设计器错误: 组件我愿意为以下内容定义属性列表: using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; namespace TestProjectForProperty.Test { public class MyTreeView : TreeView { private List _descriptorsAvailable = new List(); [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public List DescriptorsAvailable { get { return _descriptorsAvailable; } set { _descriptorsAvailable = value; } } } } 描述符本身: using System; namespace TestProjectForProperty.Test { [Serializable] public class TypeDescriptorBase { public string […]

如何在表单设计器中使Collection 类型的用户控件属性可编辑?

今天上class时,我偶然发现了一个让我疯狂的问题。 基本上我的目标是: 我有一个UserControl1 ,其字段类型为Collection ,相应的属性Collection Prop 。 像这样: public class UserControl1 : UserControl { private Collection field = null; // later changed to: //private Collection field = new Collection(); [Category(“Data”)] [DefaultValue(null)] [Description(“asdf”)] public Collection prop { get { return field; } set { field = value; } } } // later added: //[Serializable] public class […]