CanConvertFrom Method (ITypeDescriptorContext, Type)
Collapse the table of content
Expand the table of content

UriTypeConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns whether this converter can convert an object of the specified source type to an instance of the Uri type.

Namespace:  System
Assembly:  System (in System.dll)

public override bool CanConvertFrom(
	ITypeDescriptorContext context,
	Type sourceType
)

Parameters

context
Type: System.ComponentModel.ITypeDescriptorContext
An ITypeDescriptorContext that provides a format context.
sourceType
Type: System.Type
A Type that represents the type that you want to convert from.

Return Value

Type: System.Boolean
A Boolean value that is true if the converter can convert the specified type to an instance of Uri; otherwise, false.

ExceptionCondition
ArgumentNullException

sourceType is null (Nothing in Visual Basic).

The CanConvertFrom method determines if a Type can be converted to a Uri. The sourceType parameter must be String or a Uri type that can be assigned from sourceType , otherwise this method returns false.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft