This documentation is archived and is not being maintained.

ITypeDescriptorContext Interface

Provides information about the context information of a component, for example, the container that it is in and its PropertyDescriptor. The primary use of this interface is in type conversion.

For a list of all members of this type, see ITypeDescriptorContext Members.


[Visual Basic]
Public Interface ITypeDescriptorContext
   Inherits IServiceProvider
public interface ITypeDescriptorContext : IServiceProvider
public __gc __interface ITypeDescriptorContext : public
interface ITypeDescriptorContext implements IServiceProvider


This interface is typically used at design time to provide information about a design-time container.

Note   Do not rely on the presence of this interface when you design a type converter. If a particular interface, property, or service is necessary but not available, the type converter should return a null reference (Nothing in Visual Basic) rather than throw an exception. This interface's properties can return a null reference (Nothing) at any time, and you should plan for this.

The Instance property returns the instance of the object invoking this interface. For example, if a type converter is given an instance of a Color to convert, and you need to know what the color is used for before you perform the operation, Instance returns the actual instance of the control using the color. Then you can query the control for further information about its services and its Container.


Namespace: System.ComponentModel

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

ITypeDescriptorContext Members | System.ComponentModel Namespace | TypeConverter