Interface IOptionsProvider<TOptions>
- Namespace
- Acuit.Pinpoint.Workstation.Configuration
- Assembly
- Acuit.Pinpoint.Workstation.Interfaces.dll
A provider for TOptions
options.
[Obsolete("This is deprecated and will be removed in a future version; Acuit.Pinpoint.Workstation.Configuration.IOptionsRegistry should be used instead.")]
public interface IOptionsProvider<TOptions> where TOptions : class, new()
Type Parameters
TOptions
The options instance type.
Remarks
This handles updates from the configuration system, binding the configuration setting values to a TOptions
object.
Clients that are costly to initialize or that can only be initialized once should wait until IsReady is true before initializing.
The OptionsProvider<TOptions> class is normally used as the base class for implememtations of this interface. See the documentation for that class for more information.
Properties
IsReady
Gets whether Options reflects all settings (i.e., from Acuit Pinpoint Server).
bool IsReady { get; }
Property Value
Remarks
This will initially be false, and then will change to true once and only once after all settings have been loaded (i.e, the station has started).
Clients that are costly to initialize or that can only be initialized once should wait until this is true before initializing.
Options
Gets the options.
TOptions Options { get; }
Property Value
- TOptions
Remarks
This will never be null. Before options have been loaded, or when there is an error binding the configuration setting values to the TOptions
object,
this will be set to a default set of options (i.e., an instance of TOptions
created using its default constructor).
These options may be invalid (i.e., they fail data annotations validation). Implementations or clients can validate options via TryValidateObject(object, ICollection<ValidationResult>) if desired.
Methods
GetOptionsChangedToken()
Gets a IChangeToken that can be used to listen when options change.
IChangeToken GetOptionsChangedToken()
Returns
Remarks
This is useful for clients that perform asynchronous work in response to options changes.
Events
IsReadyChanged
event EventHandler IsReadyChanged
Event Type
Remarks
This will be raised once, after the station has started, ensuring settings from Acuit Pinpoint Server have been retrieved.
This event will always be raised on the main application dispatcher (i.e., user interface) thread.
OptionsChanged
Occurs when Options changes.
event EventHandler OptionsChanged
Event Type
Remarks
This event will always be raised on the main application dispatcher (i.e., user interface) thread.