TypeListConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) Método
Definição
Converte o objeto de valor especificado para o tipo de destino especificado.Converts the given value object to the specified destination type.
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);
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
Parâmetros
- context
- ITypeDescriptorContext
Um ITypeDescriptorContext que fornece um contexto de formato.An ITypeDescriptorContext that provides a format context.
- culture
- CultureInfo
Um CultureInfo opcional.An optional CultureInfo. Se não for fornecido, a cultura atual será assumida.If not supplied, the current culture is assumed.
Retornos
Um Object que representa o value convertido.An Object that represents the converted value.
Exceções
destinationType é null.destinationType is null.
A conversão não pode ser executada.The conversion cannot be performed.
Comentários
Esse método geralmente converte tipos de e para objetos de cadeia de caracteres.This method most commonly converts types to and from string objects.
O context parâmetro pode ser usado para extrair informações adicionais sobre o ambiente do qual esse conversor está sendo invocado.The context parameter can be used to extract additional information about the environment this converter is being invoked from. Isso pode ser null. Portanto, sempre verifique.This can be null, so always check. Além disso, as propriedades no objeto de contexto podem retornar null.Also, properties on the context object can return null.