CollectionEditor 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供一个用户界面,该界面可以在设计时编辑大多数类型的集合。
public ref class CollectionEditor : System::Drawing::Design::UITypeEditorpublic class CollectionEditor : System.Drawing.Design.UITypeEditortype CollectionEditor = class
    inherit UITypeEditorPublic Class CollectionEditor
Inherits UITypeEditor- 继承
- 派生
示例
下面的代码示例使用 EditorAttribute 将 与 属性相关联 CollectionEditor 。
public:
   [EditorAttribute(System::ComponentModel::Design::CollectionEditor::typeid,
      System::Drawing::Design::UITypeEditor::typeid)]
   property ICollection^ testCollection 
   {
      ICollection^ get()
      {
         return Icollection;
      }
      void set( ICollection^ value )
      {
         Icollection = value;
      }
   }
private:
   ICollection^ Icollection;
[EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public ICollection testCollection
{
    get
    {
        return Icollection;
    }
    set
    {
        Icollection = value;
    }
}
private ICollection Icollection;
<EditorAttribute(GetType(System.ComponentModel.Design.CollectionEditor), GetType(System.Drawing.Design.UITypeEditor))>  _
Public Property testCollection() As ICollection
   Get
      Return Icollection
   End Get
   Set
      Icollection = value
   End Set
End Property
Private Icollection As ICollection
继承者说明
此编辑器可以编辑具有 属性的 Item 集合。 编辑器可以从 属性确定集合 Item 的类型(如果存在)。 如果集合没有此属性,或者想要提供多个类型的集合,则可以重写此类的某些受保护成员,以自定义编辑器以支持其他类型的集合。
构造函数
| CollectionEditor(Type) | 使用指定的集合类型初始化 CollectionEditor 类的新实例。 | 
属性
| CollectionItemType | 获取集合中每项的数据类型。 | 
| CollectionType | 获取集合对象的数据类型。 | 
| Context | 获取指示当前上下文的类型说明符。 | 
| HelpTopic | 在用户按下编辑器对话框中的“帮助”按钮或 F1 键时,获取“帮助”关键字以显示“帮助”主题或主题列表。 | 
| IsDropDownResizable | 获取一个值,该值指示是否应由用户调整下拉编辑器的大小。(继承自 UITypeEditor) | 
| NewItemTypes | 获取可为此集合创建的项的可用类型。 |