语言

TypeDescriptionProvider.GetReflectionType 方法

定义

对对象执行正常反射。

重载

名称 说明
GetReflectionType(Type)

对类型执行正常反射。

GetReflectionType(Type, Object)

对具有给定类型的给定对象执行正常反射。

GetReflectionType(Object)

对给定对象执行正常反射。

GetReflectionType(Type)

Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs

对类型执行正常反射。

public:
 Type ^ GetReflectionType(Type ^ objectType);
public Type GetReflectionType(Type objectType);
member this.GetReflectionType : Type -> Type
Public Function GetReflectionType (objectType As Type) As Type

参数

objectType
Type

要为其检索的 IReflect对象的类型。

返回

此 objectType对象的反射类型。

例外

objectType 是 null。

注解

该方法 GetReflectionType 是该方法的 GetTypeDescriptor 较低版本。 如果无法为对象定位任何自定义类型描述符, GetReflectionType 则调用该描述符对对象执行正常反射。

如果已调用使用类型而不是实例的类型描述符成员,请使用此方法重载。

另请参阅

适用于

GetReflectionType(Type, Object)

Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs

对具有给定类型的给定对象执行正常反射。

public:
 virtual Type ^ GetReflectionType(Type ^ objectType, System::Object ^ instance);
public virtual Type GetReflectionType(Type objectType, object? instance);
public virtual Type GetReflectionType(Type objectType, object instance);
abstract member GetReflectionType : Type * obj -> Type
override this.GetReflectionType : Type * obj -> Type
Public Overridable Function GetReflectionType (objectType As Type, instance As Object) As Type

参数

objectType
Type

要为其检索的 IReflect对象的类型。

instance
Object

类型的实例。 可以为 null。

返回

此 objectType对象的反射类型。

注解

该方法 GetReflectionType 是该方法的 GetTypeDescriptor 较低版本。 如果无法为对象定位任何自定义类型描述符, GetReflectionType 则调用该描述符对对象执行正常反射。

继承者说明

此方法被原型化为 virtual,默认情况下,如果未传递父提供程序,则 objectType 返回此方法。 如果传递了父提供程序,此方法将调用父提供程序 GetReflectionType 的方法。

另请参阅

适用于

GetReflectionType(Object)

Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs
Source:
TypeDescriptionProvider.cs

对给定对象执行正常反射。

public:
 Type ^ GetReflectionType(System::Object ^ instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")]
public Type GetReflectionType(object instance);
public Type GetReflectionType(object instance);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")>]
member this.GetReflectionType : obj -> Type
member this.GetReflectionType : obj -> Type
Public Function GetReflectionType (instance As Object) As Type

参数

instance
Object

类型的实例(不应 null为 )。

返回

此 instance对象的反射类型。

属性

例外

instance 是 null。

注解

该方法 GetReflectionType 是该方法的 GetTypeDescriptor 较低版本。 如果无法为对象定位任何自定义类型描述符, GetReflectionType 则调用该描述符对对象执行正常反射。

如果已调用使用实例而不是类型的类型描述符成员,请使用此方法重载。

另请参阅

适用于