TypeDescriptionProvider.GetTypeDescriptor 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取给定类型或对象的自定义类型描述符。
重载
| 名称 | 说明 |
|---|---|
| GetTypeDescriptor(Object) |
获取给定对象的自定义类型描述符。 |
| GetTypeDescriptor(Type) |
获取给定类型的自定义类型描述符。 |
| GetTypeDescriptor(Type, Object) |
获取给定类型和对象的自定义类型描述符。 |
GetTypeDescriptor(Object)
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
获取给定对象的自定义类型描述符。
public:
System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(System::Object ^ instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor(object instance);
public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(object instance);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
member this.GetTypeDescriptor : obj -> System.ComponentModel.ICustomTypeDescriptor
member this.GetTypeDescriptor : obj -> System.ComponentModel.ICustomTypeDescriptor
Public Function GetTypeDescriptor (instance As Object) As ICustomTypeDescriptor
参数
- instance
- Object
类型的实例。 如果没有将实例传递给 <
返回
可为类型提供元数据的一个 ICustomTypeDescriptor 。
- 属性
例外
instance 是 null。
另请参阅
适用于
GetTypeDescriptor(Type)
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
获取给定类型的自定义类型描述符。
public:
System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(Type ^ objectType);
public System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor(Type objectType);
public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(Type objectType);
member this.GetTypeDescriptor : Type -> System.ComponentModel.ICustomTypeDescriptor
Public Function GetTypeDescriptor (objectType As Type) As ICustomTypeDescriptor
参数
- objectType
- Type
要为其检索类型描述符的对象的类型。
返回
可为类型提供元数据的一个 ICustomTypeDescriptor 。
另请参阅
适用于
GetTypeDescriptor(Type, Object)
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
- Source:
- TypeDescriptionProvider.cs
获取给定类型和对象的自定义类型描述符。
public:
virtual System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(Type ^ objectType, System::Object ^ instance);
public virtual System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor(Type objectType, object? instance);
public virtual System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance);
abstract member GetTypeDescriptor : Type * obj -> System.ComponentModel.ICustomTypeDescriptor
override this.GetTypeDescriptor : Type * obj -> System.ComponentModel.ICustomTypeDescriptor
Public Overridable Function GetTypeDescriptor (objectType As Type, instance As Object) As ICustomTypeDescriptor
参数
- objectType
- Type
要为其检索类型描述符的对象的类型。
- instance
- Object
类型的实例。 如果没有将实例传递给 <
返回
可为类型提供元数据的一个 ICustomTypeDescriptor 。
注解
此方法是原型, virtual 默认情况下,如果未传递父提供程序,则返回空描述符。 如果传递了父提供程序,此方法将调用父提供程序 GetTypeDescriptor 的方法。
继承者说明
该方法 GetTypeDescriptor(Type, Object) 应返回对象的自定义类型描述符。 如果方法未为对象提供类型信息,则它应返回 null。