Пример #1
0
 public void Start(string[] startupArguments, ServiceStoppedCallback serviceStoppedCallback)
 {
     _simpbotClient.StopCallback = () =>
     {
         if (_stopRequestedByWindows)
         {
             serviceStoppedCallback.Invoke();
         }
     };
     _simpbotClient.StartAsync().GetAwaiter();
 }
Пример #2
0
 public void Start(string[] startupArguments, ServiceStoppedCallback serviceStoppedCallback)
 {
     try
     {
         _onStart?.Invoke();
     }
     catch (Exception)
     {
         _onStopped?.Invoke();
         serviceStoppedCallback?.Invoke();
     }
 }
Пример #3
0
 public void Start(string[] startupArguments, ServiceStoppedCallback serviceStoppedCallback)
 {
     //File.Create("C:\\GotThere.ServiceBase.txt");
     try
     {
         Start();
     }
     catch (Exception exception)
     {
         Logger.LogCritical($"{ServiceName} Start threw an exception.", exception);
         serviceStoppedCallback.Invoke();
     }
 }