Esempio n. 1
0
        public static MessageBoxResult Show(string messageBoxText, string caption)
        {
            try
            {
                frmNoteBox _frmNoteBox = new frmNoteBox();
                //
                _frmNoteBox.level     = NoteBoxLevel.Note;
                _frmNoteBox.c_caption = caption;
                _frmNoteBox.Message   = messageBoxText;
                //
                _frmNoteBox.Owner = Application.Current.MainWindow;
                _frmNoteBox.ShowDialog();

                return(MessageBoxResult.OK);
            }
            catch
            {
                return(NoteBox.Show(messageBoxText, caption));
            }
        }
Esempio n. 2
0
 public static MessageBoxResult Show(string messageBoxText, string caption, NoteBoxLevel p_level)
 {
     try
     {
         frmNoteBox _frmNoteBox = new frmNoteBox();
         //
         _frmNoteBox.level     = p_level;
         _frmNoteBox.c_caption = caption;
         _frmNoteBox.Message   = messageBoxText;
         //
         bool?_result;
         _frmNoteBox.Owner = Application.Current.MainWindow;
         _result           = _frmNoteBox.ShowDialog();
         //
         if (p_level == NoteBoxLevel.Question)
         //|| p_level == NoteBoxLevel.Warning)
         {
             if (_result == true)
             {
                 return(MessageBoxResult.Yes);
             }
             else
             {
                 return(MessageBoxResult.No);
             }
         }
         else
         {
             return(MessageBoxResult.OK);
         }
     }
     catch
     {
         return(MessageBox.Show(messageBoxText, caption, MessageBoxButton.YesNo));
     }
 }