コード例 #1
0
 public SEMessageBoxButton Show(IWin32Window owner)
 {
     if (_useSavedResponse && this.Name != null)
     {
         SEMessageBoxButton savedResponse = SEMessageBoxManager.GetSavedResponse(this);
         if (savedResponse != null)
         {
             return(savedResponse);
         }
     }
     if (owner == null)
     {
         _msgBox.ShowDialog();
     }
     else
     {
         _msgBox.ShowDialog(owner);
     }
     if (this.Name != null)
     {
         if (_msgBox.AllowSaveResponse && _msgBox.SaveResponse)
         {
             SEMessageBoxManager.SetSavedResponse(this, _msgBox.Result);
         }
         else
         {
             SEMessageBoxManager.ResetSavedResponse(this.Name);
         }
     }
     else
     {
         Dispose();
     }
     return(_msgBox.Result);
 }
コード例 #2
0
        public void AddButton(SEMessageBoxButtons button)
        {
            string buttonText = SEMessageBoxManager.GetLocalizedString(button.ToString());

            if (buttonText == null)
            {
                buttonText = button.ToString();
            }
            string             buttonVal = button.ToString();
            SEMessageBoxButton btn       = new SEMessageBoxButton();

            btn.Text = buttonText;
            if (button == SEMessageBoxButtons.Cancel)
            {
                btn.IsCancelButton = true;
            }
            AddButton(btn);
        }