CollectionEditor 類別

定義

提供可在設計階段編輯大部分集合型別的使用者介面。

public ref class CollectionEditor : System::Drawing::Design::UITypeEditor
public class CollectionEditor : System.Drawing.Design.UITypeEditor
type CollectionEditor = class
    inherit UITypeEditor
Public Class CollectionEditor
Inherits UITypeEditor
繼承
CollectionEditor
衍生

範例

下列程式代碼範例會使用 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

取得集合物件 (Collection Object) 的資料型別。

Context

取得指示目前內容的型別描述項。

HelpTopic

當按下編輯器的對話方塊 [說明] 按鈕或 F1 鍵時,取得 Help 關鍵字以顯示說明主題或主題清單。

IsDropDownResizable

取得值,表示使用者是否能夠調整下拉式編輯器的大小。

(繼承來源 UITypeEditor)
NewItemTypes

取得可為這個集合建立的項目之可用型別。

方法

CancelChanges()

取消對集合所做的變更。

CanRemoveInstance(Object)

指示集合的原始成員是否可移除。

CanSelectMultipleInstances()

指示是否可以一次選取多個集合項目。

CreateCollectionForm()

建立要顯示和編輯目前集合的新表單。

CreateCollectionItemType()

取得這個集合所包含的資料型別。

CreateInstance(Type)

建立指定集合項目型別的新執行個體。

CreateNewItemTypes()

取得這個集合編輯器可包含的資料型別。

DestroyInstance(Object)

終結物件的指定執行個體。

EditValue(IServiceProvider, Object)

使用由 GetEditStyle() 方法指示的編輯器樣式,來編輯指定物件的值。

(繼承來源 UITypeEditor)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

使用指定服務提供者和內容,編輯指定物件的值。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetDisplayText(Object)

取出指定清單項目的顯示文字。

GetEditStyle()

取得 EditValue(IServiceProvider, Object) 方法所使用的編輯器樣式。

(繼承來源 UITypeEditor)
GetEditStyle(ITypeDescriptorContext)

取得 EditValue(ITypeDescriptorContext, IServiceProvider, Object) 方法所使用的編輯樣式。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetItems(Object)

取得包含指定集合的物件陣列。

GetObjectsFromInstance(Object)

傳回含有指定物件的清單。

GetPaintValueSupported()

指出這個編輯器是否支援繪製物件值的表示。

(繼承來源 UITypeEditor)
GetPaintValueSupported(ITypeDescriptorContext)

指出指定的內容是否支援在指定的內容中繪製物件值的表示。

(繼承來源 UITypeEditor)
GetService(Type)

如果有可用的服務,則取得所要求的服務。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
PaintValue(Object, Graphics, Rectangle)

將指定物件的表示值繪製到指定的畫布上。

(繼承來源 UITypeEditor)
PaintValue(PaintValueEventArgs)

使用指定的 PaintValueEventArgs 來繪製物件值的表示。

(繼承來源 UITypeEditor)
SetItems(Object, Object[])

設定指定的陣列為集合的項目。

ShowHelp()

顯示集合編輯器的預設說明主題。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱