예제 #1
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     ISLogger.MessageOut -= ISLogger_MessageOut;
     if (server == null || server.Running)
     {
         server.Stop();
     }
     trayIcon.Visible = false;
     ISLogger.Exit();
 }
예제 #2
0
 protected override void OnStop()
 {
     try
     {
         ISLogger.Write($"Stopping service...");
         ipcRead?.Close();
         spMon?.StopMonitoring();
         launcher.KillSp();
         namedIpc?.Dispose();
         cSocket?.Dispose();
         ISLogger.Exit();
     }catch (Exception) { }
 }
예제 #3
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine("UNHANDLED EXCEPTION");
            Exception ex = e.ExceptionObject as Exception;

            while (ex.InnerException != null)
            {
                ex = ex.InnerException;
            }

            ISLogger.Write(ex.Message);
            ISLogger.Exit();
        }
예제 #4
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine("UNHANDLED EXCEPTION");
            Exception ex = e.ExceptionObject as Exception;

            while (ex.InnerException != null)
            {
                ex = ex.InnerException;
            }

            ISLogger.Write(ex.Message);
            ISLogger.Exit();
            Process.GetCurrentProcess().Kill(); //kill process which will cause the service to restart the process
        }