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.

System.IServiceProvider
   System.ComponentModel.ITypeDescriptorContext

[Visual Basic]
<ComVisible(True)>
Public Interface ITypeDescriptorContext
   Inherits IServiceProvider
[C#]
[ComVisible(true)]
public interface ITypeDescriptorContext : IServiceProvider
[C++]
[ComVisible(true)]
public __gc __interface ITypeDescriptorContext : public
   IServiceProvider
[JScript]
public
   ComVisible(true)
interface ITypeDescriptorContext implements IServiceProvider

Remarks

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.

Requirements

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

Show: