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.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() as MetroStyleManager;

                if (singletonWindow.StyleManager != null)
                    singletonWindow.StyleManager.Owner = singletonWindow;
            }

            singletonWindow.Show(parent);
        }
Exemple #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 MetroTaskWindow(secToClose, userControl);
            singletonWindow.Text          = title;
            singletonWindow.Resizable     = false;
            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() as MetroStyleManager;

                if (singletonWindow.StyleManager != null)
                {
                    singletonWindow.StyleManager.OwnerForm = singletonWindow;
                }
            }

            singletonWindow.Show(parent);
        }
        private void UpdateProgress()
        {
            if (this.elapsedTime == this.closeTime)
            {
                this.timer.Dispose();
                this.timer = null;
                base.Close();
                return;
            }
            MetroTaskWindow metroTaskWindow = this;

            metroTaskWindow.elapsedTime = metroTaskWindow.elapsedTime + 5;
            if (this.cancelTimer)
            {
                this.elapsedTime = 0;
            }
            double num = (double)this.elapsedTime / ((double)this.closeTime / 100);

            this.progressWidth = (int)((double)base.Width * (num / 100));
            base.Invalidate(new Rectangle(0, 0, base.Width, 5));
            if (!this.cancelTimer)
            {
                this.timer.Reset();
            }
        }
Exemple #4
0
 // Token: 0x060003C9 RID: 969 RVA: 0x0000CC5F File Offset: 0x0000AE5F
 protected override void OnClosing(CancelEventArgs e)
 {
     base.OnClosing(e);
     if (!e.Cancel && !(this is MetroTaskWindow))
     {
         MetroTaskWindow.ForceClose();
     }
 }
Exemple #5
0
 public static void ForceClose()
 {
     if (singletonWindow != null)
     {
         CancelAutoClose();
         singletonWindow.Close();
         singletonWindow.Dispose();
         singletonWindow = null;
     }
 }
 public static void ForceClose()
 {
     if (MetroTaskWindow.singletonWindow != null)
     {
         MetroTaskWindow.CancelAutoClose();
         MetroTaskWindow.singletonWindow.Close();
         MetroTaskWindow.singletonWindow.Dispose();
         MetroTaskWindow.singletonWindow = null;
     }
 }
Exemple #7
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);
            if (e.Cancel)
            {
                return;
            }

            // TODO: This looks wrong / assuming that there's only one window
            if (!(this is MetroTaskWindow))
            {
                MetroTaskWindow.ForceClose();
            }
        }
Exemple #8
0
        protected override void OnClosing(CancelEventArgs e)
        {
            if (!(this is MetroTaskWindow))
            {
                MetroTaskWindow.ForceClose();
            }

            if (metroDropShadowForm != null)
            {
                metroDropShadowForm.Visible = false;
                metroDropShadowForm.Owner   = null;
                metroDropShadowForm         = null;
            }

            base.OnClosing(e);
        }
        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.StartPosition = FormStartPosition.Manual;

            IMetroForm parentForm = parent as IMetroForm;
            if (parentForm != null && parentForm.StyleManager != null)
            {
                ((IMetroStyledComponent)singletonWindow.metroStyleManager).InternalStyleManager = parentForm.StyleManager;
            }

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