Freigeben über


PSTypeConverter.CanConvertFrom Method

Definition

Overloads

CanConvertFrom(PSObject, Type)

Determines if the converter can convert the sourceValue parameter to the destinationType parameter.

CanConvertFrom(Object, Type)

Determines if the converter can convert the sourceValue parameter to the destinationType parameter.

CanConvertFrom(PSObject, Type)

Determines if the converter can convert the sourceValue parameter to the destinationType parameter.

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

Parameters

sourceValue
PSObject

Value supposedly not of the types supported by this converted to be converted to the destinationType parameter.

destinationType
Type

One of the types supported by this converter to which the sourceValue parameter should be converted.

Returns

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

Applies to

CanConvertFrom(Object, Type)

Determines if the converter can convert the sourceValue parameter to the destinationType parameter.

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

Parameters

sourceValue
Object

Value supposedly not of the types supported by this converted to be converted to the destinationType parameter.

destinationType
Type

One of the types supported by this converter to which the sourceValue parameter should be converted.

Returns

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

Applies to