Пример #1
0
        private static void ButtonShow(MsgButton button, JXMessageBox msgBox)
        {
            msgBox.button = button;
            switch (button)
            {
            case MsgButton.OK:
                msgBox.btnConfirm.Content = "确定";
                break;

            case MsgButton.Yes:
                msgBox.btnConfirm.Content = "是";
                break;

            case MsgButton.Yes_No:
                msgBox.btnConfirm.Content = "是";
                //msgBox.btnNo.Visibility = Visibility.Visible;
                break;

            case MsgButton.OK_Cancel:
                msgBox.btnConfirm.Content   = "确定";
                msgBox.btnCancel.Visibility = Visibility.Visible;
                break;

            case MsgButton.Yes_No_Cancel:
                msgBox.btnConfirm.Content   = "是";
                msgBox.btnCancel.Visibility = Visibility.Visible;
                // msgBox.btnNo.Visibility = Visibility.Visible;
                break;
            }
        }
Пример #2
0
        public static MsgResult Show(Window win, string DisplayMessage, MsgImage img)
        {
            JXMessageBox msgBox = new JXMessageBox();
            msgBox.txtDisplayMessage.Text = DisplayMessage;
            string imageUrl = "";
            switch (img)
            {
                case MsgImage.Error:
                    imageUrl = @"../Images/error.png";
                    break;
                case MsgImage.Success:
                    imageUrl = @"../Images/success.png";
                    break;

                case MsgImage.Question:
                    imageUrl = @"../Images/question.png";
                    break;
                case MsgImage.Exclamation:
                    imageUrl = @"../Images/wonder.png";
                    break;
            }
            if (img != MsgImage.None)
            {
                msgBox.imgInfo.Visibility = Visibility.Visible;
                msgBox.imgInfo.Source = msgBox.imgSource(imageUrl);
            }
            else
                msgBox.imgInfo.Visibility = Visibility.Collapsed;
            if (win != null)
            msgBox.Owner = win;
            msgBox.ShowDialog();
            return msgBox.msgResult;
        }
Пример #3
0
        public static MsgResult Show(Window win, string displayMessage, string caption)
        {
            JXMessageBox msgBox = new JXMessageBox();

            msgBox.txtDisplayMessage.Text  = displayMessage;
            msgBox.lblMessageTitle.Content = caption;
            if (win != null)
            {
                msgBox.Owner = win;
            }
            msgBox.ShowDialog();
            return(msgBox.msgResult);
        }
Пример #4
0
        public static MsgResult Show(Window win, string displayMessage, string caption, MsgButton button, MsgImage img)
        {
            JXMessageBox msgBox = new JXMessageBox();

            msgBox.txtDisplayMessage.Text  = displayMessage;
            msgBox.lblMessageTitle.Content = caption;
            ButtonShow(button, msgBox);

            string imageUrl = "";

            switch (img)
            {
            case MsgImage.Error:
                imageUrl = @"../Images/error.png";
                break;

            case MsgImage.Success:
                imageUrl = @"../Images/success.png";
                break;

            case MsgImage.Question:
                imageUrl = @"../Images/question.png";
                break;

            case MsgImage.Exclamation:
                imageUrl = @"../Images/wonder.png";
                break;
            }
            if (img != MsgImage.None)
            {
                msgBox.imgInfo.Visibility = Visibility.Visible;
                msgBox.imgInfo.Source     = msgBox.imgSource(imageUrl);
            }
            else
            {
                msgBox.imgInfo.Visibility = Visibility.Collapsed;
            }
            if (win != null)
            {
                msgBox.Owner = win;
            }
            msgBox.ShowDialog();
            return(msgBox.msgResult);
        }
Пример #5
0
 public static MsgResult Show(Window win, string displayMessage, string caption, MsgButton button)
 {
     JXMessageBox msgBox = new JXMessageBox();
     msgBox.txtDisplayMessage.Text = displayMessage;
     msgBox.lblMessageTitle.Content = caption;
     ButtonShow(button, msgBox);
     if (win != null)
         msgBox.Owner = win;
     msgBox.ShowDialog();
     return msgBox.msgResult;
 }
Пример #6
0
 private static void ButtonShow(MsgButton button, JXMessageBox msgBox)
 {
     msgBox.button = button;
     switch (button)
     {
         case MsgButton.OK:
             msgBox.btnConfirm.Content = "确定";
             break;
         case MsgButton.Yes:
             msgBox.btnConfirm.Content = "是";
             break;
         case MsgButton.Yes_No:
             msgBox.btnConfirm.Content = "是";
             //msgBox.btnNo.Visibility = Visibility.Visible;
             break;
         case MsgButton.OK_Cancel:
             msgBox.btnConfirm.Content = "确定";
             msgBox.btnCancel.Visibility = Visibility.Visible;
             break;
         case MsgButton.Yes_No_Cancel:
             msgBox.btnConfirm.Content = "是";
             msgBox.btnCancel.Visibility = Visibility.Visible;
            // msgBox.btnNo.Visibility = Visibility.Visible;
             break;
     }
 }