Επεξεργασία

Κοινή χρήση μέσω


TypeDescriptionProvider.GetTypeDescriptor Method

Definition

Gets a custom type descriptor for the given type or object.

Overloads

GetTypeDescriptor(Object)

Gets a custom type descriptor for the given object.

GetTypeDescriptor(Type)

Gets a custom type descriptor for the given type.

GetTypeDescriptor(Type, Object)

Gets a custom type descriptor for the given type and object.

GetTypeDescriptor(Object)

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

Gets a custom type descriptor for the given object.

public:
 System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(System::Object ^ instance);
public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor (object instance);
public System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor (object instance);
member this.GetTypeDescriptor : obj -> System.ComponentModel.ICustomTypeDescriptor
Public Function GetTypeDescriptor (instance As Object) As ICustomTypeDescriptor

Parameters

instance
Object

An instance of the type. Can be null if no instance was passed to the TypeDescriptor.

Returns

An ICustomTypeDescriptor that can provide metadata for the type.

Exceptions

instance is null.

See also

Applies to

GetTypeDescriptor(Type)

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

Gets a custom type descriptor for the given type.

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

Parameters

objectType
Type

The type of object for which to retrieve the type descriptor.

Returns

An ICustomTypeDescriptor that can provide metadata for the type.

See also

Applies to

GetTypeDescriptor(Type, Object)

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

Gets a custom type descriptor for the given type and object.

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

Parameters

objectType
Type

The type of object for which to retrieve the type descriptor.

instance
Object

An instance of the type. Can be null if no instance was passed to the TypeDescriptor.

Returns

An ICustomTypeDescriptor that can provide metadata for the type.

Remarks

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

Notes to Inheritors

The GetTypeDescriptor(Type, Object) method should return a custom type descriptor for the object. If the method does not provide type information for the object, it should return null.

See also

Applies to