| ObjectHelperConvertToT Method (Object) |
Converts the object to the specified target type.
Namespace: DigitalRuneAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public static T ConvertTo<T>(
Object value
)
Public Shared Function ConvertTo(Of T) (
value As Object
) As T
public:
generic<typename T>
static T ConvertTo(
Object^ value
)
static member ConvertTo :
value : Object -> 'T
Parameters
- value
- Type: SystemObject
The value to convert.
Type Parameters
- T
- The target type.
Return Value
Type:
TA value of type
T.
Exceptions Exception | Condition |
---|
FormatException | value is not in a format for T recognized by the
current format provider.
|
InvalidCastException |
This conversion is not supported.
Or, value is and T is a
value type. Or, value does not implement the IConvertible
interface.
|
OverflowException | value represents a number that is out of the range of
T.
|
See Also