Export (0) Print
Expand All

CollectionEditor Class

Provides a user interface that can edit most types of collections at design time.

Namespace: System.ComponentModel.Design
Assembly: System.Design (in system.design.dll)

public class CollectionEditor : UITypeEditor
public class CollectionEditor extends UITypeEditor
public class CollectionEditor extends UITypeEditor
Not applicable.

Notes to Inheritors: This editor can edit collections that have an Item property. The editor can determine the type of the collection from the Item property, if it exists. If the collection does not have this property, or if you want to provide collections of more than one type, you can override certain protected members of this class to customize the editor to support other types of collections.

The following code example uses an EditorAttribute to associate the CollectionEditor with a property.

[EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public ICollection testCollection
{
    get
    {
        return Icollection;
    }
    set
    {
        Icollection = value;
    }
}
private ICollection Icollection;

/** @attribute EditorAttribute(System.ComponentModel.Design.
    CollectionEditor.class, System.Drawing.Design.UITypeEditor.class)
 */
/** @property 
 */
public ICollection get_TestCollection()
{
    return iCollection;
} //get_TestCollection

/** @property 
 */
public void set_TestCollection(ICollection value)
{
    iCollection = value;
} //set_TestCollection

private ICollection iCollection;

System.Object
   System.Drawing.Design.UITypeEditor
    System.ComponentModel.Design.CollectionEditor
       Derived Classes

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft