CollectionEditor.CreateCollectionItemType 方法

定义

获取此集合包含的数据类型。Gets the data type that this collection contains.

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

返回

Type

集合中项的数据类型,如果对于该集合未找到 Item 属性,则为 ObjectThe data type of the items in the collection, or an Object if no Item property can be located on the collection.

注解

可以从属性检索集合项的数据类型 CollectionItemType ,此方法比此方法更快。You can retrieve the data type of the items of the collection from the CollectionItemType property, which is faster than this method.

此方法不需要由用户调用,除非在派生类中已重写并实现此方法。This method does not need to be called by users, except in derived classes where this method has been overridden and implemented.

此方法的默认实现将返回集合的属性的数据类型 Item (如果存在)。The default implementation of this method returns the data type of the Item property of the collection, if it exists.

继承者说明

开发人员可以选择重写此方法,以支持不遵循典型和受支持的集合模型的集合,或者在性能至关重要时,基于反射的类型解析速度太慢。Developers can choose to override this method to support collections that do not follow the typical and supported collection model, or when performance is critical, and reflection-based type resolution is too slow.

适用于