SelectionRangeConverter.CreateInstance Method (ITypeDescriptorContext, IDictionary)


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

Creates a SelectionRange object by using the specified type descriptor and set of property values for that object.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public override object CreateInstance(
	ITypeDescriptorContext context,
	IDictionary propertyValues


Type: System.ComponentModel.ITypeDescriptorContext

A ITypeDescriptorContext that provides a format context.

Type: System.Collections.IDictionary

An IDictionary that contains the new property values.

Return Value

Type: System.Object

If successful, the newly created SelectionRange; otherwise, this method throws an exception.

Exception Condition

propertyValues is null or its Start and End elements could not be converted into a SelectionRange.

Use the CreateInstance method to make changes to an existing immutable object by creating a modified version of it. This method expects the propertyValues parameter to have elements with key values of Start and End, each with the corresponding DateTime value.

.NET Framework
Available since 1.1
Return to top