HelperCheckConditionT Method (Boolean, String) |
Confirms that a condition is true. Raise an exception of type T if it is not.
Namespace: Bio.UtilAssembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax public static void CheckCondition<T>(
bool condition,
string message
)
where T : new(), Exception
Public Shared Sub CheckCondition(Of T As {New, Exception}) (
condition As Boolean,
message As String
)
public:
generic<typename T>
where T : gcnew(), Exception
static void CheckCondition(
bool condition,
String^ message
)
static member CheckCondition :
condition : bool *
message : string -> unit when 'T : new() and Exception
Parameters
- condition
- Type: SystemBoolean
The condition to check - message
- Type: SystemString
A message for the exception
Type Parameters
- T
- The type of exception that will be raised.
Remarks
Warning: The message with be evaluated even if the condition is true, so don't make it's calculation slow.
Avoid this with the "messageFunction" version.
See Also