Open sandboxFocus

Class InvariantSuspensionCounter

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

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.