Compartilhar via


PSTypeConverter.CanConvertTo Method

Definition

Overloads

CanConvertTo(PSObject, Type)

Returns true if the converter can convert the sourceValue parameter to the destinationType parameter.

CanConvertTo(Object, Type)

Returns true if the converter can convert the sourceValue parameter to the destinationType parameter.

CanConvertTo(PSObject, Type)

Returns true if the converter can convert the sourceValue parameter to the destinationType parameter.

public:
 virtual bool CanConvertTo(System::Management::Automation::PSObject ^ sourceValue, Type ^ destinationType);
public virtual bool CanConvertTo (System.Management.Automation.PSObject sourceValue, Type destinationType);
abstract member CanConvertTo : System.Management.Automation.PSObject * Type -> bool
override this.CanConvertTo : System.Management.Automation.PSObject * Type -> bool
Public Overridable Function CanConvertTo (sourceValue As PSObject, destinationType As Type) As Boolean

Parameters

sourceValue
PSObject

Value supposedly from one of the types supported by this converter to be converted to the destinationType parameter.

destinationType
Type

Type to convert the sourceValue parameter, supposedly not one of the types supported by the converter.

Returns

True if the converter can convert the sourceValue parameter to the destinationType parameter, otherwise false.

Applies to

CanConvertTo(Object, Type)

Returns true if the converter can convert the sourceValue parameter to the destinationType parameter.

public:
 abstract bool CanConvertTo(System::Object ^ sourceValue, Type ^ destinationType);
public:
 abstract bool CanConvertTo(Platform::Object ^ sourceValue, Platform::Type ^ destinationType);
public abstract bool CanConvertTo (object sourceValue, Type destinationType);
abstract member CanConvertTo : obj * Type -> bool
Public MustOverride Function CanConvertTo (sourceValue As Object, destinationType As Type) As Boolean

Parameters

sourceValue
Object

Value supposedly from one of the types supported by this converter to be converted to the destinationType parameter.

destinationType
Type

Type to convert the sourceValue parameter, supposedly not one of the types supported by the converter.

Returns

True if the converter can convert the sourceValue parameter to the destinationType parameter, otherwise false.

Applies to