コード例 #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.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);
        }
コード例 #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);
        }
コード例 #3
0
        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();
            }
        }
コード例 #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();
     }
 }
コード例 #5
0
 public static void ForceClose()
 {
     if (singletonWindow != null)
     {
         CancelAutoClose();
         singletonWindow.Close();
         singletonWindow.Dispose();
         singletonWindow = null;
     }
 }
コード例 #6
0
 public static void ForceClose()
 {
     if (MetroTaskWindow.singletonWindow != null)
     {
         MetroTaskWindow.CancelAutoClose();
         MetroTaskWindow.singletonWindow.Close();
         MetroTaskWindow.singletonWindow.Dispose();
         MetroTaskWindow.singletonWindow = null;
     }
 }
コード例 #7
0
ファイル: MetroForm.cs プロジェクト: toyoh3232/autotools
        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();
            }
        }
コード例 #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);
        }
コード例 #9
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;

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

            singletonWindow.Show(parent);
        }
コード例 #10
0
 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();
 }
コード例 #11
0
 public static void ForceClose()
 {
     if (singletonWindow != null)
     {
         CancelAutoClose();
         singletonWindow.Close();
         singletonWindow.Dispose();
         singletonWindow = null;
     }
 }
コード例 #12
0
 public static void ShowTaskWindow(string text, Control userControl)
 {
     MetroTaskWindow.ShowTaskWindow(null, text, userControl);
 }
コード例 #13
0
 public static void ShowTaskWindow(string text, Control userControl, int secToClose)
 {
     MetroTaskWindow.ShowTaskWindow(null, text, userControl, secToClose);
 }
コード例 #14
0
 public static void ShowTaskWindow(IWin32Window parent, string text, Control userControl)
 {
     MetroTaskWindow.ShowTaskWindow(parent, text, userControl, 0);
 }