Beispiel #1
0
        public static void ShowTaskWindow(IWin32Window parent, string title, Control userControl, int secToClose)
        {
            if (singletonWindow != null)
            {
                singletonWindow.Close();
                singletonWindow.Dispose();
                singletonWindow = null;
            }

            singletonWindow               = new MetroTaskWindow(secToClose, userControl);
            singletonWindow.Text          = title;
            singletonWindow.Resizable     = false;
            singletonWindow.Movable       = true;
            singletonWindow.StartPosition = FormStartPosition.Manual;

            if (parent != null && parent is IMetroForm)
            {
                singletonWindow.Theme        = ((IMetroForm)parent).Theme;
                singletonWindow.Style        = ((IMetroForm)parent).Style;
                singletonWindow.StyleManager =
                    ((IMetroForm)parent).StyleManager.Clone(singletonWindow) as MetroStyleManager;
            }

            singletonWindow.Show();
        }
Beispiel #2
0
 public static void ForceClose()
 {
     if (singletonWindow != null)
     {
         CancelAutoClose();
         singletonWindow.Close();
         singletonWindow.Dispose();
         singletonWindow = null;
     }
 }