Table of Contents

Interface IInitializableOptions

Namespace
Acuit.Pinpoint.Workstation.Configuration
Assembly
Acuit.Pinpoint.Workstation.Interfaces.dll

Options managed by IOptionsRegistry or IDeviceRegistry that perform additional initialization should implement this interface.

public interface IInitializableOptions

Methods

InitializeOptionsAsync(IOptionsLoader)

Initializes options.

Task InitializeOptionsAsync(IOptionsLoader optionsLoader)

Parameters

optionsLoader IOptionsLoader

The options loader, which provides services for recording health problems or retrieving files from Acuit Pinpoint Server.

Returns

Task

Remarks

This is typically used to allow options classes to perform further initialization after they have been constructed and initialized from configuration settings, performing tasks like:

  • Retrieving files from Acuit Pinpoint Server.
  • Calculating derived options values.

Any problems that occur while performing this initialization should be handled by calling RecordHealthCheckProblem(HealthCheckResult) of optionsLoader. Any exception thrown from this method will result in an unhandled application exception.

This will be called even if there was a problem binding or validating the options from the configuration settings. The HealthCheckResult property of optionsLoader can be checked to determine whether there were any problems.

Note that this will only be called on the top-level options type (e.g., the type specified via RegisterOptions<TOptions>(string, string) or RegisterDeviceType(Type, DeviceTypeRegistrationOptions)). If any members within the top-level options type member hierarchy also implement this class, then the top-level options type should implement this class and explicitly call the contained member(s) implementation.

This will be called from the main application dispatcher thread.