using System; namespace ZeroLevel.Services.AsService { public interface HostConfigurator { /// /// Specifies the name of the service as it should be displayed in the service control manager /// /// void SetDisplayName(string name); /// /// Specifies the name of the service as it is registered in the service control manager /// /// void SetServiceName(string name); /// /// Specifies the description of the service that is displayed in the service control manager /// /// void SetDescription(string description); /// /// Specifies the service instance name that should be used when the service is registered /// /// void SetInstanceName(string instanceName); /// /// Sets the amount of time to wait for the service to start before timing out. Default is 10 seconds. /// /// void SetStartTimeout(TimeSpan startTimeOut); /// /// Sets the amount of time to wait for the service to stop before timing out. Default is 10 seconds. /// /// void SetStopTimeout(TimeSpan stopTimeOut); /// /// Enable pause and continue support for the service (default is disabled) /// void EnablePauseAndContinue(); /// /// Enable support for service shutdown (signaled by the host OS) /// void EnableShutdown(); /// /// Enables support for the session changed event /// void EnableSessionChanged(); /// /// Enables support for power events (signaled by the host OS) /// void EnablePowerEvents(); /// /// Specifies the builder factory to use when the service is invoked /// /// void UseHostBuilder(HostBuilderFactory hostBuilderFactory); /// /// Sets the service builder to use for creating the service /// /// void UseServiceBuilder(ServiceBuilderFactory serviceBuilderFactory); /// /// Sets the environment builder to use for creating the service (defaults to Windows) /// /// void UseEnvironmentBuilder(EnvironmentBuilderFactory environmentBuilderFactory); /// /// Adds a a configurator for the host builder to the configurator /// /// void AddConfigurator(HostBuilderConfigurator configurator); /// /// Parses the command line options and applies them to the host configurator /// void ApplyCommandLine(); /// /// Parses the command line options from the specified command line and applies them to the host configurator /// /// void ApplyCommandLine(string commandLine); /// /// Adds a command line switch (--name) that can be either true or false. Switches are CASE SeNsITiVe /// /// The name of the switch, as it will appear on the command line /// void AddCommandLineSwitch(string name, Action callback); /// /// Adds a command line definition (-name:value) that can be specified. the name is case sensitive. If the /// definition /// /// /// void AddCommandLineDefinition(string name, Action callback); /// /// Specifies a callback to be run when Topshelf encounters an exception while starting, running /// or stopping. This callback does not replace Topshelf's default handling of any exceptions, and /// is intended to allow for local cleanup, logging, etc. This is not required, and is only invoked /// if a callback is provided. /// /// The action to run when an exception occurs. void OnException(Action callback); /// /// The policy that will be used when Topself detects an UnhandledException in the /// application. The default policy is to log an error and to stop the service. /// UnhandledExceptionPolicyCode UnhandledExceptionPolicy { get; set; } } }