XmlLanguageConverter.ConvertTo Method (ITypeDescriptorContext, CultureInfo, Object, Type)

 

Converts the specified XmlLanguage to the specified type.

Namespace:   System.Windows.Markup
Assembly:  PresentationCore (in PresentationCore.dll)

[SecurityCriticalAttribute]
public override object ConvertTo(
	ITypeDescriptorContext typeDescriptorContext,
	CultureInfo cultureInfo,
	object value,
	Type destinationType
)

Parameters

typeDescriptorContext
Type: System.ComponentModel.ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

cultureInfo
Type: System.Globalization.CultureInfo

The CultureInfo to use as the current culture.

value
Type: System.Object

The object to convert. This is expected to be type XmlLanguage.

destinationType
Type: System.Type

A type that represents the type you want to convert to.

Return Value

Type: System.Object

An object that represents the converted value.

Exception Condition
InvalidOperationException

Conversion could not be performed.

ArgumentNullException

destinationType is null.

For destinationType String, this method returns the IetfLanguageTag value of the provided XmlLanguage. For destinationType InstanceDescriptor this method returns an InstanceDescriptor instance that is useful for serialization. Other destinationType inputs throw exceptions.

.NET Framework
Available since 3.0
Return to top
Show: