語言

TypeDescriptionProvider.GetReflectionType 方法

定義

對物體進行正常反射。

多載

名稱 Description
GetReflectionType(Type)

對型別執行一般反映。

GetReflectionType(Type, Object)

針對具有指定型別的指定物件執行一般反映。

GetReflectionType(Object)

對指定的物件執行一般反映。

GetReflectionType(Type)

來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
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)

來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
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)

來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
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 則呼叫以對物件進行法線反射。

如果你呼叫了一個使用實例而非型別的型別描述符成員,請使用此方法過載。

另請參閱

適用於