public static void ForceClose() { if (singletonWindow != null) { CancelAutoClose(); singletonWindow.Close(); singletonWindow.Dispose(); singletonWindow = null; } }
public static void ShowTaskWindow(IWin32Window parent, string title, Control userControl, int secToClose) { if (singletonWindow != null) { singletonWindow.Close(); singletonWindow.Dispose(); singletonWindow = null; } singletonWindow = new WellsMetroTaskWindow(secToClose, userControl); singletonWindow.Text = title; singletonWindow.Resizable = false; singletonWindow.Movable = true; singletonWindow.StartPosition = FormStartPosition.Manual; if (parent != null && parent is IWellsMetroForm) { singletonWindow.Theme = ((IWellsMetroForm)parent).Theme; singletonWindow.Style = ((IWellsMetroForm)parent).Style; singletonWindow.StyleManager = ((IWellsMetroForm)parent).StyleManager.Clone(singletonWindow) as WellsMetroStyleManager; } singletonWindow.Show(); }