Modifier

Partager via


SelectionRangeConverter.ConvertFrom Method

Definition

Converts the specified value to the converter's native type by using the specified locale.

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value);
public override object? ConvertFrom (System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object value);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj
Public Overrides Function ConvertFrom (context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As Object

Parameters

context
ITypeDescriptorContext

A ITypeDescriptorContext that provides a format context.

culture
CultureInfo

The locale information for the conversion.

value
Object

The Object to convert.

Returns

An Object that represents the converted value.

Exceptions

value is of type String but could not be parsed into two strings representing dates.

value is of type String that was parsed into two strings, but the conversion of one or both into the DateTime type did not succeed.

Remarks

The ConvertFrom method is specialized to convert String values that represent a range of dates to their SelectionRange representations. Types other than String are passed to the base class implementation of this method.

Notes to Inheritors

Override this method to provide your own conversion requirements.

The context parameter can be used to extract additional information about the environment this converter is being invoked from. The parameter may be null, so you should always verify the information. Also, properties on the context object may also return null.

Applies to

See also