Пример #1
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;
        }
Пример #2
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);
        }
Пример #3
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);
        }
Пример #4
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;
 }