BuiltInRoleConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) Método

Definição

Converte o objeto especificado em outro tipo.Converts the given object to another 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.

culture
CultureInfo

A cultura na qual o value será convertido.The culture into which value will be converted.

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

Object

O objeto convertido.The converted object.

Exceções

destinationType é Nothing.destinationType is Nothing.

A conversão não pode ser executada.The conversion cannot be performed.

Comentários

Os tipos mais comuns para converter e converter de são objetos de cadeia de caracteres.The most common types to convert to and convert from are string objects. A implementação padrão faz uma chamada para ToString no objeto se o objeto for válido e se o tipo de destino for String .The default implementation makes a call to ToString on the object if the object is valid and if the destination type is String.

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 Nothing. Portanto, sempre verifique.This can be Nothing, so always check. Além disso, as propriedades no objeto de contexto podem retornar Nothing.Also, properties on the context object can return Nothing.

Este conversor de tipo dá suporte ao User objeto Visual Basic.This type converter supports the Visual Basic User object.

Aplica-se a

Confira também