private bool Handler(CtrlType signal) { switch (signal) { case CtrlType.CTRL_BREAK_EVENT: case CtrlType.CTRL_C_EVENT: case CtrlType.CTRL_LOGOFF_EVENT: case CtrlType.CTRL_SHUTDOWN_EVENT: case CtrlType.CTRL_CLOSE_EVENT: Console.WriteLine("Closing"); proxy.Unsubscribe(); proxy.Close(); Environment.Exit(0); return(false); default: return(false); } }
private void StoreClientForm_FormClosing(object sender, FormClosingEventArgs e) { proxy.Unsubscribe(); proxy.Close(); }