Прочетете на английски Редактиране

Споделяне чрез


TypeDescriptionProvider.GetReflectionType Method

Definition

Performs normal reflection against an object.

Overloads

GetReflectionType(Type)

Performs normal reflection against a type.

GetReflectionType(Type, Object)

Performs normal reflection against the given object with the given type.

GetReflectionType(Object)

Performs normal reflection against the given object.

GetReflectionType(Type)

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

Performs normal reflection against a type.

C#
public Type GetReflectionType(Type objectType);

Parameters

objectType
Type

The type of object for which to retrieve the IReflect.

Returns

The type of reflection for this objectType.

Exceptions

objectType is null.

Remarks

The GetReflectionType method is a lower-level version of the GetTypeDescriptor method. If no custom type descriptor can be located for an object, GetReflectionType is called to perform normal reflection against the object.

Use this method overload if you have called a type descriptor member that uses a type instead of an instance.

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

GetReflectionType(Type, Object)

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

Performs normal reflection against the given object with the given type.

C#
public virtual Type GetReflectionType(Type objectType, object? instance);
C#
public virtual Type GetReflectionType(Type objectType, object instance);

Parameters

objectType
Type

The type of object for which to retrieve the IReflect.

instance
Object

An instance of the type. Can be null.

Returns

The type of reflection for this objectType.

Remarks

The GetReflectionType method is a lower-level version of the GetTypeDescriptor method. If no custom type descriptor can be located for an object, GetReflectionType is called to perform normal reflection against the object.

Notes to Inheritors

This method is prototyped as virtual, and by default returns objectType if no parent provider was passed. If a parent provider was passed, this method will invoke the parent provider's GetReflectionType method.

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

GetReflectionType(Object)

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

Performs normal reflection against the given object.

C#
public Type GetReflectionType(object instance);

Parameters

instance
Object

An instance of the type (should not be null).

Returns

The type of reflection for this instance.

Exceptions

instance is null.

Remarks

The GetReflectionType method is a lower-level version of the GetTypeDescriptor method. If no custom type descriptor can be located for an object, GetReflectionType is called to perform normal reflection against the object.

Use this method overload if you have called a type descriptor member that uses an instance instead of a type.

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1