Exemple #1
0
        public static DialogResult ShowMsgBox(string string_9, string string_10, string string_11, params string[] msgParams)
        {
            DialogResult result2;

            try
            {
                string         messageBody = "";
                MessageManager manager     = new MessageManager(string_9);
                DialogResult   oK          = DialogResult.OK;
                if (manager.MessageBody != null)
                {
                    messageBody = manager.MessageBody;
                    if ((msgParams != null) && (msgParams.Length > 0))
                    {
                        for (int i = 0; i < msgParams.Length; i++)
                        {
                            messageBody = messageBody.Replace("{" + i.ToString() + "}", msgParams[i]);
                        }
                    }
                }
                if (string.Empty.Equals(messageBody))
                {
                    messageBody = string_9;
                }
                if (((!(manager.string_3 == "CC") && !(manager.string_3 == "CI")) && (!(manager.string_3 == "CE") && !(manager.string_3 == "CQ"))) && !(manager.string_3 == "CW"))
                {
                    oK = new SysMessageBox(((string_10 == null) || (string_10 == "")) ? manager.string_4 : string_10, messageBody, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                else
                {
                    oK = new CusMessageBox(((string_10 == null) || (string_10 == "")) ? manager.string_4 : string_10, DateTime.Now.ToString(), ((string_11 == null) || (string_11 == "")) ? manager.string_5 : string_11, manager.string_1, messageBody, manager.string_6, manager.string_7, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                result2 = oK;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result2);
        }
Exemple #2
0
        public static DialogResult ShowMsgBox(string string_9)
        {
            //return MessageBox.Show(string_9, "发生异常", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            DialogResult result2;

            try
            {
                string         messageBody = "";
                MessageManager manager     = new MessageManager(string_9);
                DialogResult   oK          = DialogResult.OK;
                if (manager.MessageBody != null)
                {
                    messageBody = manager.MessageBody;
                }
                if (string.Empty.Equals(messageBody))
                {
                    messageBody = string_9;
                }
                if (((!(manager.string_3 == "CC") && !(manager.string_3 == "CI")) && (!(manager.string_3 == "CE") && !(manager.string_3 == "CQ"))) && !(manager.string_3 == "CW"))
                {
                    oK = new SysMessageBox(manager.string_4, messageBody, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                else
                {
                    oK = new CusMessageBox(manager.string_4, DateTime.Now.ToString(), manager.string_5, manager.string_1, messageBody, manager.string_6, manager.string_7, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                result2 = oK;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result2);
        }
        public static DialogResult Show(string string_0, string string_1, MessageBoxButtons messageBoxButtons_0)
        {
            MessageBoxIcon asterisk;

            switch (messageBoxButtons_0)
            {
            case MessageBoxButtons.OK:
                asterisk = MessageBoxIcon.Asterisk;
                break;

            case MessageBoxButtons.OKCancel:
                asterisk = MessageBoxIcon.Asterisk;
                break;

            case MessageBoxButtons.AbortRetryIgnore:
                asterisk = MessageBoxIcon.Hand;
                break;

            case MessageBoxButtons.YesNoCancel:
                asterisk = MessageBoxIcon.Asterisk;
                break;

            case MessageBoxButtons.YesNo:
                asterisk = MessageBoxIcon.Asterisk;
                break;

            case MessageBoxButtons.RetryCancel:
                asterisk = MessageBoxIcon.Hand;
                break;

            default:
                asterisk = MessageBoxIcon.Asterisk;
                break;
            }
            SysMessageBox box = new SysMessageBox(string_1, string_0, messageBoxButtons_0, asterisk, MessageBoxDefaultButton.Button1);

            return(box.ShowDialog());
        }
        public static DialogResult Show(string string_0, string string_1, MessageBoxButtons messageBoxButtons_0, MessageBoxIcon messageBoxIcon_0, MessageBoxDefaultButton messageBoxDefaultButton_0)
        {
            SysMessageBox box = new SysMessageBox(string_1, string_0, messageBoxButtons_0, messageBoxIcon_0, messageBoxDefaultButton_0);

            return(box.ShowDialog());
        }
        public static DialogResult Show(string string_0, string string_1)
        {
            SysMessageBox box = new SysMessageBox(string_1, string_0, MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);

            return(box.ShowDialog());
        }
Exemple #6
0
        public static DialogResult ShowMsgBox(string string_9, List <KeyValuePair <string, string> > attrsCollection, string[] string_10, string[] string_11)
        {
            DialogResult result2;

            try
            {
                string         messageBody = "";
                string         solution    = "";
                MessageManager manager     = new MessageManager(string_9);
                DialogResult   oK          = DialogResult.OK;
                if ((attrsCollection != null) && (attrsCollection.Count > 0))
                {
                    foreach (KeyValuePair <string, string> pair in attrsCollection)
                    {
                        if (pair.Key.Equals("type"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_3 = pair.Value;
                            }
                        }
                        else if (pair.Key.Equals("value"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_2 = pair.Value;
                            }
                        }
                        else if (pair.Key.Equals("title"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_4 = pair.Value;
                            }
                        }
                        else if (pair.Key.Equals("operate"))
                        {
                            if ((pair.Value != null) && (pair.Value != ""))
                            {
                                manager.string_5 = pair.Value;
                            }
                        }
                        else if ((pair.Key.Equals("solution") && (pair.Value != null)) && (pair.Value != ""))
                        {
                            manager.string_6 = pair.Value;
                        }
                    }
                }
                if (manager.MessageBody != null)
                {
                    messageBody = manager.MessageBody;
                    if ((string_10 != null) && (string_10.Length > 0))
                    {
                        for (int i = 0; i < string_10.Length; i++)
                        {
                            messageBody = messageBody.Replace("{" + i.ToString() + "}", string_10[i]);
                        }
                    }
                }
                if (manager.Solution != null)
                {
                    solution = manager.Solution;
                    if ((string_11 != null) && (string_11.Length > 0))
                    {
                        for (int j = 0; j < string_11.Length; j++)
                        {
                            solution = solution.Replace("{" + j.ToString() + "}", string_11[j]);
                        }
                    }
                }
                if (string.Empty.Equals(messageBody))
                {
                    messageBody = string_9;
                }
                if (((!(manager.string_3 == "CC") && !(manager.string_3 == "CI")) && (!(manager.string_3 == "CE") && !(manager.string_3 == "CQ"))) && !(manager.string_3 == "CW"))
                {
                    oK = new SysMessageBox(manager.string_4, messageBody, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                else
                {
                    oK = new CusMessageBox(manager.string_4, DateTime.Now.ToString(), manager.string_5, manager.string_1, messageBody, solution, manager.string_7, manager.messageBoxButtons_0, manager.messageBoxIcon_0, manager.messageBoxDefaultButton_0)
                    {
                        TopMost = true
                    }.ShowDialog();
                }
                result2 = oK;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(result2);
        }