CollectionEditor.CreateCollectionItemType 方法

定義

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

protected:
 virtual Type ^ CreateCollectionItemType();
protected virtual Type CreateCollectionItemType ();
abstract member CreateCollectionItemType : unit -> Type
override this.CreateCollectionItemType : unit -> Type
Protected Overridable Function CreateCollectionItemType () As Type

傳回

集合中項目的資料型別,或 Object (如果集合上沒有 Item 屬性)。

備註

您可以從 屬性擷取集合 CollectionItemType 項目的數據類型,這比這個方法快。

除了已覆寫並實作此方法的衍生類別之外,使用者不需要呼叫這個方法。

如果集合的 Item 屬性存在,這個方法的預設實作會傳回數據類型。

給繼承者的注意事項

開發人員可以選擇覆寫這個方法,以支援未遵循一般和支援集合模型的集合,或當效能很重要,且以反映為基礎的類型解析太慢時。

適用於