次の方法で共有


CollectionEditor クラス

ほとんどの型のコレクションを編集するためにデザイン時に利用できるユーザー インターフェイスを提供します。

この型のすべてのメンバの一覧については、CollectionEditor メンバ を参照してください。

System.Object
   System.Drawing.Design.UITypeEditor
      System.ComponentModel.Design.CollectionEditor
         System.ComponentModel.Design.ArrayEditor
         System.Web.UI.Design.WebControls.ListItemsCollectionEditor
         System.Web.UI.Design.WebControls.TableCellsCollectionEditor
         System.Web.UI.Design.WebControls.TableRowsCollectionEditor

Public Class CollectionEditor
   Inherits UITypeEditor
[C#]
public class CollectionEditor : UITypeEditor
[C++]
public __gc class CollectionEditor : public UITypeEditor
[JScript]
public class CollectionEditor extends UITypeEditor

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

解説

継承時の注意: このエディタでは、Item プロパティを持つコレクションを編集できます。このエディタは、Item プロパティがある場合、その値からコレクションの型を判断します。コレクションにこのプロパティがない場合、または複数の型のコレクションを編集する場合は、このクラスの特定のプロテクト メンバをオーバーライドして、他の型のコレクションもサポートするようにエディタをカスタマイズできます。

使用例

[Visual Basic, C#, C++] EditorAttribute を使用して、 CollectionEditor とプロパティを関連付けるコード例を次に示します。

 
<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

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

[C++] 
public:
    [EditorAttribute(__typeof(System::ComponentModel::Design::CollectionEditor),
        __typeof(System::Drawing::Design::UITypeEditor))]
    __property ICollection* get_testCollection() {
        return Icollection;
    }
    [EditorAttribute(__typeof(System::ComponentModel::Design::CollectionEditor),
        __typeof(System::Drawing::Design::UITypeEditor))]
    __property void set_testCollection(ICollection* value) {
        Icollection = value;
    }
private:
    ICollection*  Icollection;

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.ComponentModel.Design

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System.Design (System.Design.dll 内)

参照

CollectionEditor メンバ | System.ComponentModel.Design 名前空間 | UITypeEditor