TypeDescriptionProvider.GetTypeDescriptor Method (Type, Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public virtual ICustomTypeDescriptor GetTypeDescriptor(
	Type objectType,
	object instance
)

Parameters

objectType
Type: System.Type

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

instance
Type: System.Object

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

Return Value

Type: System.ComponentModel.ICustomTypeDescriptor

An ICustomTypeDescriptor that can provide metadata for the type.

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 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.

.NET Framework
Available since 2.0
Return to top
Show: