Checks the data type of a value before casting it to the type
T.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim value As Object
Dim throwOnError As Boolean
Dim value As T
value = BaseVariableState.CheckTypeBeforeCast(Of T)(value, throwOnError)
|
Parameters
- value
- The value.
- throwOnError
- if set to
true
ServiceResultException is thrown on error.
Type Parameters
- T
- The framework type of value contained in the variable.
Return Value
Returns
value or default for
T
Exceptions
Requirements
Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x
See Also