DecimalConverter.CanConvertTo(ITypeDescriptorContext, Type) Método

Definição

Obtém um valor que indica se este conversor pode converter um objeto no tipo de destino fornecido usando o contexto.Gets a value indicating whether this converter can convert an object to the given destination type using the context.

public:
 override bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ destinationType);
public override bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext context, Type destinationType);
override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertTo (context As ITypeDescriptorContext, destinationType As Type) As Boolean

Parâmetros

context
ITypeDescriptorContext

Um ITypeDescriptorContext que fornece um contexto de formato.An ITypeDescriptorContext that provides a format context.

destinationType
Type

Um Type que representa o tipo no qual você deseja converter.A Type that represents the type you wish to convert to.

Retornos

Boolean

true se esse conversor puder realizar a conversão; caso contrário, false.true if this converter can perform the conversion; otherwise, false.

Comentários

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.

Notas aos Herdeiros

Substitua esse método para fornecer seus próprios requisitos de conversão.Override this method to provide your own conversion requirements.

Aplica-se a

Confira também