ICustomTypeDescriptor 接口

定义

提供为对象提供动态自定义类型信息的接口。

public interface class ICustomTypeDescriptor
public interface ICustomTypeDescriptor
type ICustomTypeDescriptor = interface
Public Interface ICustomTypeDescriptor
派生

注解

接口 ICustomTypeDescriptor 允许对象提供有关自身的类型信息。 通常,当对象需要动态类型信息时,将使用此接口。 相反, TypeDescriptor 类提供从元数据获取的静态类型信息。

例如, ICustomTypeDescriptor 在.NET Framework中用于提供 COM 对象的类型信息。 COM 对象不支持属性或属性。 因此,.NET Framework使用 ICustomTypeDescriptor 实现 COM 对象的属性和特性。

若要提供动态自定义类型信息,类可以实现 ICustomTypeDescriptor 或派生自 CustomTypeDescriptor 类,该类提供此接口的简单实现。

注意

对实现 ICustomTypeDescriptor 接口的对象的数据绑定没有设计时支持。 此外,当绑定到 的 ICustomTypeDescriptor运行时实例时,将忽略基础类型的公共属性。

方法

GetAttributes()

返回此组件实例的自定义属性的集合。

GetClassName()

返回此组件实例的类名称。

GetComponentName()

返回某个组件的此实例的名称。

GetConverter()

返回此组件实例的类型转换器。

GetDefaultEvent()

返回某个组件的此实例的默认事件。

GetDefaultProperty()

返回此组件实例的默认属性。

GetEditor(Type)

返回此组件实例的指定类型的编辑器。

GetEvents()

返回此组件实例的事件。

GetEvents(Attribute[])

使用指定的属性数组作为筛选器,返回此组件实例的事件。

GetProperties()

返回此组件实例的属性。

GetProperties(Attribute[])

使用特性数组作为筛选器,返回此组件实例的属性。

GetPropertyOwner(PropertyDescriptor)

返回一个对象,该对象包含指定的属性描述符所描述的属性。

适用于

另请参阅