Esempio n. 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 PoisonTaskWindow(secToClose, userControl)
            {
                Text          = title,
                Resizable     = false,
                Movable       = true,
                StartPosition = FormStartPosition.Manual
            };

            if (parent != null && parent is IPoisonForm form)
            {
                singletonWindow.Theme        = form.Theme;
                singletonWindow.Style        = form.Style;
                singletonWindow.StyleManager = form.StyleManager.Clone(singletonWindow) as PoisonStyleManager;
            }

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