Contract.

Requires<TException>(bool) Method

Summary

Specifies a precondition.
Namespace
Avalonia
Containing Type
Contract

Syntax

[MethodImpl(MethodImplOptions.AggressiveInlining)]
[ContractAnnotation("condition:false=>stop")]
public static void Requires<TException>(bool condition) where TException : Exception, new()

Attributes

Type Description
MethodImplAttribute
ContractAnnotation

Type Parameters

Name Description
TException The exception to throw if condition is false.

Parameters

Name Type Description
condition bool The precondition.

Return Value

Type Description
void