PointConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) Método
Definição
Converte o objeto especificado no tipo especificado.Converts the specified object to the specified 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 contexto do formatador.A formatter context. Esse objeto pode ser usado para obter mais informações sobre o ambiente do qual este conversor está sendo chamado.This object can be used to get additional information about the environment this converter is being called from. Isso pode ser null, portanto, você sempre deve verificar.This may be null, so you should always check. Além disso, as propriedades no objeto de contexto também podem retornar null.Also, properties on the context object may also return null.
- culture
- CultureInfo
Um objeto que contém informações específicas da cultura, como o idioma, calendário e convenções culturais associadas a uma cultura específica.An object that contains culture specific information, such as the language, calendar, and cultural conventions associated with a specific culture. Ele é baseado no padrão RFC 1766.It is based on the RFC 1766 standard.
- value
- Object
O objeto a ser convertido.The object to convert.
- destinationType
- Type
O tipo no qual converter o objeto.The type to convert the object to.
Retornos
O objeto convertido.The converted object.
Exceções
Não foi possível concluir a conversão.The conversion cannot be completed.
Comentários
Os tipos mais comuns para converter são de e para um objeto de cadeia de caracteres.The most common types to convert are to and from a string object. A implementação padrão chama o método do objeto ToString se o objeto for válido e se o tipo de destino for cadeia de caracteres.The default implementation calls the object's ToString method if the object is valid and if the destination type is string. Se esse método não puder converter para o tipo de destino, isso gerará uma NotSupportedException exceção.If this method cannot convert to the destination type, this will throw a NotSupportedException exception.