Esempio n. 1
0
        // **********************************
        // Output an error or warning message
        // **********************************
        public static DialogResult Show(string messageTitle, string messageText, MessageBoxIcon messageBoxIcon, MessageBoxButtons messageButtons, bool neverShowTouchOptimized = false)
        {
            // If we are running in SebWindowsClient we need to activate it before showing the password dialog
            if (SEBClientInfo.SebWindowsClientForm != null)
            {
                SebWindowsClientMain.SEBToForeground();
            }

            DialogResult messageBoxResult;

            if (!neverShowTouchOptimized && (Boolean)SEBClientInfo.getSebSetting(SEBSettings.KeyTouchOptimized)[SEBSettings.KeyTouchOptimized] == true)
            {
                messageBoxResult =
                    MetroMessageBox.Show(
                        new Form()
                {
                    TopMost = true,
                    Top     = 0,
                    Left    = 0,
                    Width   = Screen.PrimaryScreen.Bounds.Width,
                    Height  = Screen.PrimaryScreen.Bounds.Height
                }, messageText, messageTitle, messageButtons, messageBoxIcon);
            }
            else
            {
                messageBoxResult = MessageBox.Show(new Form()
                {
                    TopMost = true
                }, messageText, messageTitle, messageButtons, messageBoxIcon);
            }

            return(messageBoxResult);
        }
Esempio n. 2
0
        public static DialogResult Show(string messageTitle, string messageText, MessageBoxIcon messageBoxIcon, MessageBoxButtons messageButtons, bool neverShowTouchOptimized = false)
        {
            if (SEBClientInfo.SebWindowsClientForm != null)
            {
                SebWindowsClientMain.SEBToForeground();
            }
            DialogResult dialogResult;

            if (!neverShowTouchOptimized && (bool)SEBClientInfo.getSebSetting("touchOptimized")["touchOptimized"])
            {
                Form form = new Form();
                form.TopMost = true;
                int num1 = 0;
                form.Top = num1;
                int num2 = 0;
                form.Left = num2;
                Rectangle bounds = Screen.PrimaryScreen.Bounds;
                int       width  = bounds.Width;
                form.Width = width;
                bounds     = Screen.PrimaryScreen.Bounds;
                int height1 = bounds.Height;
                form.Height = height1;
                string message = messageText;
                string title   = messageTitle;
                int    num3    = (int)messageButtons;
                int    num4    = (int)messageBoxIcon;
                int    height2 = 211;
                dialogResult = MetroMessageBox.Show((IWin32Window)form, message, title, (MessageBoxButtons)num3, (MessageBoxIcon)num4, height2);
            }
            else
            {
                Form form = new Form();
                form.TopMost = true;
                string text    = messageText;
                string caption = messageTitle;
                int    num1    = (int)messageButtons;
                int    num2    = (int)messageBoxIcon;
                dialogResult = MessageBox.Show((IWin32Window)form, text, caption, (MessageBoxButtons)num1, (MessageBoxIcon)num2);
            }
            return(dialogResult);
        }