Table of Contents

Class ToggleGuard

Namespace
Executables.Guards
Assembly
executables.dll

Guard with runtime-switchable access state. By default, access is allowed until Deny() is called.

public class ToggleGuard : Guard
Inheritance
ToggleGuard
Inherited Members

Constructors

ToggleGuard(string)

Guard with runtime-switchable access state. By default, access is allowed until Deny() is called.

public ToggleGuard(string errorMessage)

Parameters

errorMessage string

Message returned when access is denied.

Properties

ErrorMessage

Error message used when access is denied.

public override string ErrorMessage { get; }

Property Value

string

Methods

Allow()

Allows access for subsequent invocations.

public void Allow()

Deny()

Denies access for subsequent invocations.

public void Deny()

TryGetAccess()

Returns true when access is granted.

public override bool TryGetAccess()

Returns

bool