Muokkaa

Jaa


MarginsConverter.CanConvertFrom(ITypeDescriptorContext, Type) Method

Definition

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);
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

Parameters

context
ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

sourceType
Type

A Type that represents the type from which you want to convert.

Returns

true if an object can perform the conversion; otherwise, false.

Remarks

The context parameter can be used to extract additional information about the environment from which this converter is being invoked. This can be null, so always check. Also, properties on the context object can return null.

Applies to

See also