/// <summary> /// Call this method on place where StopScreen should be displayed! /// </summary> static public void ShowStopScreen() { try { if (stopScreen != null) { return; } task = Task.Factory.StartNew(() => { Console.WriteLine("## New StopScreen Task started!"); StopScreen.ShowStopScreenForm(); }); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static private void ShowStopScreenForm() { stopScreen = new StopScreen(); Application.Run(stopScreen); }