Converts a source to the given type.

Namespace: MonoSoftware.Core
Assembly: MonoSoftware.Core (in MonoSoftware.Core.dll) Version: 1.0.40.669 (1.0.40.669)

Syntax

C#
public static T ConvertTo<T>(
	this Object source,
	TypeConverter typeConverter
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function ConvertTo(Of T) ( 
	source As Object,
	typeConverter As TypeConverter
) As T
Visual C++
public:
[ExtensionAttribute]
generic<typename T>
static T ConvertTo(
	Object^ source, 
	TypeConverter^ typeConverter
)
F#
static member ConvertTo : 
        source : Object * 
        typeConverter : TypeConverter -> 'T 

Parameters

source
Type: System..::..Object
Source to convert
typeConverter
Type: System.ComponentModel..::..TypeConverter
Type converter used to convert value

Type Parameters

T
Convert to type

Return Value

Type: T
Converted source to given type

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also