コード例 #1
0
        internal Win32ServiceHost([NotNull] IPausableWin32Service service, [NotNull] INativeInterop nativeInterop)
        {
            if (service == null)
            {
                throw new System.ArgumentNullException(nameof(service));
            }

            this.nativeInterop = nativeInterop ?? throw new System.ArgumentNullException(nameof(nativeInterop));
            serviceName        = service.ServiceName;
            stateMachine       = new PausableServiceStateMachine(service);

            serviceMainFunctionDelegate   = ServiceMainFunction;
            serviceControlHandlerDelegate = HandleServiceControlCommand;
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new <see cref="PausableServiceStateMachine"/> to run the specified service.
 /// </summary>
 /// <param name="serviceImplementation">The service implementation.</param>
 public PausableServiceStateMachine(IPausableWin32Service serviceImplementation)
 {
     this.serviceImplementation = serviceImplementation;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new <see cref="IPausableWin32Service"/> to run the specified windows service implementation.
 /// </summary>
 /// <param name="service">The windows service implementation about to be run.</param>
 public Win32ServiceHost([NotNull] IPausableWin32Service service) : this(service, Win32Interop.Wrapper)
 {
 }