Cuemon .NET Framework
TernaryIf<T,TResult>(Boolean,Doer<T,TResult>,Doer<T,TResult>,T) Method

The type of the parameter of the function delegates firstExpression and secondExpression.
The type of the result.
When true, the firstExpression is invoked and becomes the result; when false, the secondExpression is invoked and becomes the result.
The function delegate that is invoked when condition is true.
The function delegate that is invoked when condition is false.
The parameter of the function delegates firstExpression and secondExpression.
Returns one of two values depending on the value of condition.
Syntax
'Declaration
 
Public Overloads Shared Function TernaryIf
    (Of T,TResult)( _
   ByVal condition As Boolean, _
   ByVal firstExpression As Cuemon.Doer(Of T,TResult), _
   ByVal secondExpression As Cuemon.Doer(Of T,TResult), _
   ByVal arg As T _
) As TResult
public static TResult TernaryIf<T,TResult>( 
   bool condition,
   Cuemon.Doer<T,TResult> firstExpression,
   Cuemon.Doer<T,TResult> secondExpression,
   T arg
)

Parameters

condition
When true, the firstExpression is invoked and becomes the result; when false, the secondExpression is invoked and becomes the result.
firstExpression
The function delegate that is invoked when condition is true.
secondExpression
The function delegate that is invoked when condition is false.
arg
The parameter of the function delegates firstExpression and secondExpression.

Type Parameters

T
The type of the parameter of the function delegates firstExpression and secondExpression.
TResult
The type of the result.

Return Value

The result of either function delegate firstExpression or function delegate secondExpression.
Requirements

Target Platforms: Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Condition Class
Condition Members
Overload List

 

 


| Cuemon is licensed under a The MIT License (MIT)



© 2009-2015 Weubphoria. All Rights Reserved.

Documentation made easy with Document! X by Innovasys

Send Feedback