Grasshopper API
UtilityTernaryIfT Method |
Note: This API is now obsolete.
Type safe implementation of the IIf conditional statement.
Namespace: Grasshopper
Assembly: Grasshopper (in Grasshopper.dll)

[ObsoleteAttribute("Ternary conditionals are now part of the standard C# and VB language spec. Consider using those instead.")] public static T TernaryIf<T>( bool condition, T A, T B )
<ObsoleteAttribute("Ternary conditionals are now part of the standard C# and VB language spec. Consider using those instead.")> Public Shared Function TernaryIf(Of T) ( condition As Boolean, A As T, B As T ) As T
Parameters
- condition
- Type: SystemBoolean
If True, A is returned. - A
- Type: T
Value to return when condition evaluates to true. - B
- Type: T
Value to return when condition evaluates to false.
Type Parameters
- T
- Type of statement.
Return Value
Type: T