static void RaiseShutdownEvent(ShutdownEventArgs args) { Shutdown?.Invoke(args); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { var args = new ShutdownEventArgs(e.ExceptionObject as Exception); RaiseShutdownEvent(args); }
static bool Kernel32_ProcessShuttingDown(ShutdownReason sig) { ShutdownEventArgs args = new ShutdownEventArgs(sig); RaiseShutdownEvent(args); return false; }
static void CurrentDomain_ProcessExit(object sender, EventArgs e) { var args = new ShutdownEventArgs(ShutdownReason.ReachEndOfMain); RaiseShutdownEvent(args); }
static void RaiseShutdownEvent(ShutdownEventArgs args) { Shutdown?.Invoke(args); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { var args = new ShutdownEventArgs(e.ExceptionObject as Exception); RaiseShutdownEvent(args); }
static void CurrentDomain_ProcessExit(object sender, EventArgs e) { var args = new ShutdownEventArgs(ShutdownReason.ReachEndOfMain); RaiseShutdownEvent(args); }
static void RaiseShutdownEvent(ShutdownEventArgs args) { if (null != Shutdown) Shutdown(args); }