MarginsConverter.CanConvertFrom(ITypeDescriptorContext, Type) Método

Definição

Retorna se esse conversor pode converter um objeto do tipo de origem especificado no tipo nativo do conversor usando o contexto especificado.Returns whether this converter can convert an object of the specified source type to the native type of the converter using the specified context.

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

Parâmetros

context
ITypeDescriptorContext

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

sourceType
Type

Um Type que representa o tipo do qual você deseja converter.A Type that represents the type from which you want to convert.

Retornos

Boolean

true se um objeto puder realizar a conversão; caso contrário, false.true if an object 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 from which this converter is being invoked. 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.

Aplica-se a

Confira também