/// <summary> /// OnStop: Put your stop code here /// - Stop threads, set final data, etc. /// </summary> protected override void OnStop() { if (ussdManager != null) { ussdManager.Stop(); waitEvent.Set(); } }
static void OnCancelKeyPress(object sender, ConsoleCancelEventArgs e) { ussdManager.Stop(); waitEvent.Set(); e.Cancel = true; }