| Visual Basic (Usage) | Copy Code |
|---|---|
Dim source As Object Dim sourceType As TypeInfo Dim targetType As BuiltInType Dim value As Object value = TypeInfo.Cast(source, sourceType, targetType) | |
| C# | |
|---|---|
public static object Cast( object source, TypeInfo sourceType, BuiltInType targetType ) | |
Parameters
- source
- The instance of a source value.
- sourceType
- Type of the source.
- targetType
- Type of the target.
Return Value
Return casted value.| Exception | Description |
|---|---|
| System.InvalidCastException | if imposible to cast. |
Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x