ReferenceConverter.ConvertTo Metod

Definition

Konverterar det angivna värdeobjektet till referenstypen med hjälp av den angivna kontexten och argumenten.

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

Parametrar

context
ITypeDescriptorContext

En ITypeDescriptorContext som ger en formatkontext.

culture
CultureInfo

En CultureInfo som anger den kultur som används för att representera teckensnittet.

value
Object

Att Object konvertera.

destinationType
Type

Den typ som objektet ska konverteras till.

Returer

Det konverterade objektet.

Undantag

destinationType är null.

Konverteringen kan inte utföras.

Kommentarer

Den här metoden konverterar oftast typer till och från strängobjekt.

Parametern context kan användas för att extrahera ytterligare information om miljön som konverteraren anropas från. Detta kan vara null, så kontrollera alltid. Dessutom kan egenskaper för kontextobjektet returnera null.

Gäller för