Ejemplo n.º 1
0
 /// <summary>
 /// Initializes the deafult buttons with the default functions on the MessageBox.
 /// </summary>
 /// <param name="buttonType">button type to display on the MessageBox.</param>
 /// <param name="exception">CustomException object</param>
 public MessageBox(CustomException ex, MessageBoxDefaultButtonEnum buttonType)
 {
     this.Message = ex.AlertMessage;
     this.Caption = ex.Caption;
     /* you can set the event for the button funtion e.g.
         call server side event.
         this.CallBackFunction = function(v,m,f){if(v == 'OK'){setTimeout('__doPostBack(\\'btnFake\\',\\'\\')', 0);}}
     */
     this.CallBackFunction = "null";
     SetDefaultSingleButtonSettings(buttonType);
 }
Ejemplo n.º 2
0
 public static MessageBox Show(string text, string caption, MessageBoxButtonsEnum buttons, MessageBoxIconEnum icon, MessageBoxDefaultButtonEnum defaultButton)
 {
     return(Show(text, caption, buttons, icon, defaultButton, null));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the default values of the PromptMessage.
 /// </summary>
 /// <param name="buttonType"></param>
 private void SetDefaultSingleButtonSettings(MessageBoxDefaultButtonEnum buttonType)
 {
     this.Buttons = new List<MessageButton>();
     switch (buttonType)
     {
         case MessageBoxDefaultButtonEnum.OK:
             {
                 this.Buttons.Add(new MessageButton(MessageBoxDefaultButtonEnum.OK.ToString(), MessageBoxDefaultButtonEnum.OK.ToString()));
                 break;
             }
         case MessageBoxDefaultButtonEnum.CANCEL:
             {
                 this.Buttons.Add(new MessageButton("CANCEL", "CANCEL"));
                 break;
             }
         case MessageBoxDefaultButtonEnum.YES:
             {
                 this.Buttons.Add(new MessageButton("YES", "YES"));
                 break;
             }
         case MessageBoxDefaultButtonEnum.NO:
             {
                 this.Buttons.Add(new MessageButton("NO", "NO"));
                 break;
             }
     }
     this.Focus = 0;
 }
Ejemplo n.º 4
0
        public static MessageBox Show(string text, string caption, MessageBoxButtonsEnum buttons, MessageBoxIconEnum icon, MessageBoxDefaultButtonEnum defaultButton, MessageBoxCallback callback)
        {
            var r = new MessageBox();

            r.Centered       = true;
            r.Caption        = caption;
            r._buttons       = buttons;
            r._icon          = icon;
            r._defaultButton = defaultButton;
            r.Init();
            r._label.Value = text;
            r._callback    = callback;
            var root = (qxDotNet.UI.Container.Composite)Common.ApplicationState.Instance.GUI.GetRoot();

            r._host = root;
            root.Add(r);
            r.Open();
            return(r);
        }