Click or drag to resize

UtilityTernaryIfT Method

Note: This API is now obsolete.

Type safe implementation of the IIf conditional statement.

Namespace:  Grasshopper
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
[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
)

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
See Also