Esempio n. 1
0
 public static void ForceClose()
 {
     if (singletonWindow != null)
     {
         CancelAutoClose();
         singletonWindow.Close();
         singletonWindow.Dispose();
         singletonWindow = null;
     }
 }
Esempio n. 2
0
        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();
        }