Table of Contents

Interface IMonitoredOptions<TOptions>

Namespace
Acuit.Pinpoint.Configuration.Options
Assembly
Acuit.Pinpoint.Configuration.dll

Provides a TOptions options instance, monitoring it for changes.

public interface IMonitoredOptions<TOptions> where TOptions : class, new()

Type Parameters

TOptions

The options instance type.

Properties

CurrentValue

Gets the current value of the options.

TOptions CurrentValue { get; }

Property Value

TOptions

Remarks

The configuration section for these options will be monitored and this value will be updated whenever the configuration is reloaded.

If the configuration section does not exist, this will be set to an instance of this class created via a parameterless constructor.

If there is an error binding the configuration section to a TOptions object, the value will not be changed and will continue to be its previous setting (or a new instance created via a parameterless constructor if there was no previous value). LoadError will be set to the error.

IsConfigured

Gets whether the options are configured.

bool IsConfigured { get; }

Property Value

bool

Remarks

This will be true if the configuration section exists, even if it could not be successfully bound to a TOptions object (i.e., when LoadError is not null).

LoadError

Gets the error if the options could not be loaded, or null if there was no error.

Exception LoadError { get; }

Property Value

Exception

Events

Reloaded

Occurs when the options are reloaded.

event EventHandler Reloaded

Event Type

EventHandler