MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsInvariant­Suspension­Counter
Open sandboxFocus

InvariantSuspensionCounter Class

A class used by the InvariantAttribute aspect to count the number of times the SuspendInvariants method has been invoked.

Inheritance
InvariantSuspensionCounter
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public sealed class InvariantSuspensionCounter : Object

Constructors

Name Description
InvariantSuspensionCounter()

Properties

Name Description
AreInvariantsSuspended

Gets a value indicating whether the verification of invariants is currently suspended.

Methods

Name Description
Decrement()

Decrements the counter and returns true if the counter is back to zero. Note that this does not verify invariants in this case.

Increment()

Increments the counter.