System.ComponentModel.ReferenceConverter Class

Provides a type converter to convert object references to and from other representations.

See Also: ReferenceConverter


public class ReferenceConverter : TypeConverter


The ReferenceConverter is typically used within the context of sited components or a design environment. Without a component site or a usable ITypeDescriptorContext, this converter is of little use.

This converter converts a reference of an object that implements the IComponent interface and displays its properties in the Properties window.

For more information about type converters, see the TypeConverter base class and How to: Implement a Type Converter.


You should never create an instance of the ReferenceConverter class. Instead, call the TypeDescriptor.GetConverter(Object) method of the TypeDescriptor class. For more information, see the examples in the TypeConverter base class.

This class provides the ReferenceConverter.IsValueAllowed(ITypeDescriptorContext,Object) method to check whether a particular value can be added to the standard values collection. If you do not want to add the value to the collection, override this method.


Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,

The members of System.ComponentModel.ReferenceConverter are listed below.

See Also: TypeConverter

Public Constructors

Initializes a new instance of the ReferenceConverter class.

Public Methods

CanConvertFrom(ITypeDescriptorContext, Type) : Boolean

Gets a value indicating whether this converter can convert an object in the given source type to a reference object using the specified context.

ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) : Object

Converts the given object to the reference type.

ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) : Object

Converts the given value object to the reference type using the specified context and arguments.

GetStandardValues(ITypeDescriptorContext) : TypeConverter+StandardValuesCollection

Gets a collection of standard values for the reference data type.

GetStandardValuesExclusive(ITypeDescriptorContext) : Boolean

Gets a value indicating whether the list of standard values returned from ReferenceConverter.GetStandardValues(ITypeDescriptorContext) is an exclusive list.

GetStandardValuesSupported(ITypeDescriptorContext) : Boolean

Gets a value indicating whether this object supports a standard set of values that can be picked from a list.

Protected Methods

IsValueAllowed(ITypeDescriptorContext, Object) : Boolean

Returns a value indicating whether a particular value can be added to the standard values collection.