Click or drag to resize

CommonIIfT Method

Returns one of two strongly-typed objects.

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.205-beta+5ef4169f3b1079d8b163dd363614f656bd140924
Syntax
public static T IIf<T>(
	bool expression,
	T truePart,
	T falsePart
)
View Source

Parameters

expression  Boolean
The expression you want to evaluate.
truePart  T
Returned if expression evaluates to True.
falsePart  T
Returned if expression evaluates to False.

Type Parameters

T
Return type used for immediate expression

Return Value

T
One of two objects, depending on the evaluation of given expression.
Remarks

This function acts as a strongly-typed immediate if (a.k.a. inline if).

It is expected that this function will only be used in languages that do not support ?: conditional operations, e.g., Visual Basic.NET. In Visual Basic this function can be used as a strongly-typed IIf replacement by specifying "Imports GSF.Common".

See Also