Exemplo n.º 1
0
 public void Run()
 {
     Console.WriteLine($"Starting {Assembly.GetEntryAssembly().FullName} in console, press CTRL+C to exit . . .");
     Console.WriteLine();
     Console.CancelKeyPress += ConsoleOnCancelKeyPress;
     _instance.Start();
     _cancelEvent.Wait();
     Console.WriteLine("CTRL+C pressed, stopping...");
     _instance.Dispose();
 }
Exemplo n.º 2
0
 protected override void OnStop()
 {
     try
     {
         _instance.Dispose();
     }
     catch (Exception ex)
     {
         File.WriteAllText("stop.err.log", ex.ToString());
     }
 }
Exemplo n.º 3
0
 private void TryDispose()
 {
     try
     {
         _instance?.Dispose();
     }
     catch
     {
         // Not much we can do here
     }
 }