コード例 #1
0
ファイル: MsgBox.cs プロジェクト: dalinhuang/myitopgpscar
        /// <summary>
        /// 提示框
        /// </summary>
        /// <param name="infos">提示信息</param>
        /// <param name="type">类型INFO,ERROR,QUESTION,WARNING</param>
        public static void MessageShow(string infos, string type)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Message = infos;
            config.Buttons = MessageBox.Button.OK;
            if (type == "INFO")
            {
                config.Title = "提示";
                config.Icon = MessageBox.Icon.INFO;

            }
            else if (type == "ERROR")
            {
                config.Title = "错误";
                config.Icon = MessageBox.Icon.ERROR;
            }
            else if (type == "QUESTION")
            {
                config.Title = "询问";
                config.Icon = MessageBox.Icon.QUESTION;
            } else if (type == "WARNING") {
                config.Title = "警告";
                config.Icon = MessageBox.Icon.WARNING;
            } else {
                config.Title = "提示";
                config.Icon = MessageBox.Icon.INFO;
            }
            X.MessageBox.Show(config);
        }
コード例 #2
0
        public MessageBox Alert(string title, string msg, MessageBoxButtonsConfig buttonsConfig)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title   = title;
            config.Message = msg;
            config.Buttons = Button.OK;
            config.MessageBoxButtonsConfig = buttonsConfig;

            return(this.Configure(config));
        }
コード例 #3
0
        public MessageBox Progress(string title, string msg, string progressText)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Progress = true;
            config.Closable = true;
            config.ProgressText = progressText;

            return this.Configure(config);
        }
コード例 #4
0
        public MessageBox Alert(string title, string msg, JFunction fn, string scope)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title   = title;
            config.Message = msg;
            config.Buttons = Button.OK;
            config.Fn      = fn;
            config.Scope   = scope;

            return(this.Configure(config));
        }
コード例 #5
0
        /// <summary>
        /// Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm). If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked will be passed as the only parameter to the callback (could also be the top-right close button).
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="buttonsConfig">A MessageBoxButtonsConfig object for configuring the Text value and JavaScript Handler for each MessageBox Button.</param>
        public MessageBox Confirm(string title, string msg, MessageBoxButtonsConfig buttonsConfig)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title   = title;
            config.Message = msg;
            config.Buttons = Button.YESNO;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.Icon = Icon.QUESTION;

            return(this.Configure(config));
        }
コード例 #6
0
        public MessageBox Progress(string title, string msg, string progressText)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title        = title;
            config.Message      = msg;
            config.Progress     = true;
            config.Closable     = true;
            config.ProgressText = progressText;

            return(this.Configure(config));
        }
コード例 #7
0
ファイル: MessageBox.Wait.cs プロジェクト: emayk/Ext.NET.Pro
        public MessageBox Wait(string msg, string title, WaitConfig config)
        {
            MessageBoxConfig config2 = new MessageBoxConfig();
            config2.Title = title;
            config2.Message = msg;
            config2.Closable = false;
            config2.Wait = true;
            config2.Modal = true;
            config2.WaitConfig = config;

            return this.Configure(config2);
        }
コード例 #8
0
        /// <summary>
        /// Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="buttonsConfig">A MessageBoxButtonsConfig object for configuring the Text value and JavaScript Handler for each MessageBox Button.</param>
        public MessageBox Prompt(string title, string msg, MessageBoxButtonsConfig buttonsConfig)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title   = title;
            config.Message = msg;
            config.Buttons = Button.OKCANCEL;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.MinWidth = Unit.Pixel(250);
            config.Prompt   = true;

            return(this.Configure(config));
        }
コード例 #9
0
        public MessageBox Wait(string msg, string title, WaitConfig config)
        {
            MessageBoxConfig config2 = new MessageBoxConfig();

            config2.Title      = title;
            config2.Message    = msg;
            config2.Closable   = false;
            config2.Wait       = true;
            config2.Modal      = true;
            config2.WaitConfig = config;

            return(this.Configure(config2));
        }
コード例 #10
0
        public MessageBox Confirm(string title, string msg, JFunction fn, string scope)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title   = title;
            config.Message = msg;
            config.Buttons = Button.YESNO;
            config.Fn      = fn;
            config.Scope   = scope;
            config.Icon    = Icon.QUESTION;

            return(this.Configure(config));
        }
コード例 #11
0
        /// <summary>
        /// Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="fn">(optional) The callback function invoked after the message box is closed</param>
        /// <param name="scope">(optional) The scope of the callback function</param>
        /// <param name="multiline">(optional) True to create a multiline textbox using the defaultTextHeight property, or the height in pixels to create the textbox (defaults to false / single-line)</param>
        /// <param name="value">(optional) Default value of the text input element (defaults to '')</param>
        public MessageBox Prompt(string title, string msg, JFunction fn, string scope, bool multiline, string value)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title     = title;
            config.Message   = msg;
            config.Buttons   = Button.OKCANCEL;
            config.Fn        = fn;
            config.MinWidth  = Unit.Pixel(250);
            config.Scope     = scope;
            config.Prompt    = true;
            config.Multiline = multiline;
            config.Value     = value;

            return(this.Configure(config));
        }
コード例 #12
0
        /// <summary>
        /// Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="buttonsConfig">A MessageBoxButtonsConfig object for configuring the Text value and JavaScript Handler for each MessageBox Button.</param>
        /// <param name="scope">(optional) The scope of the callback function</param>
        /// <param name="multiline">(optional) True to create a multiline textbox using the defaultTextHeight property, or the height in pixels to create the textbox (defaults to false / single-line)</param>
        /// <param name="value">(optional) Default value of the text input element (defaults to '')</param>
        public MessageBox Prompt(string title, string msg, MessageBoxButtonsConfig buttonsConfig, string scope, Unit multiline, string value)
        {
            MessageBoxConfig config = new MessageBoxConfig();

            config.Title   = title;
            config.Message = msg;
            config.Buttons = Button.OKCANCEL;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.MinWidth        = Unit.Pixel(250);
            config.Scope           = scope;
            config.Prompt          = true;
            config.MultilineHeight = multiline;
            config.Value           = value;

            return(this.Configure(config));
        }
コード例 #13
0
        /// <summary>
        /// Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="fn">(optional) The callback function invoked after the message box is closed</param>
        /// <param name="scope">(optional) The scope of the callback function</param>
        /// <param name="multiline">(optional) True to create a multiline textbox using the defaultTextHeight property, or the height in pixels to create the textbox (defaults to false / single-line)</param>
        /// <param name="value">(optional) Default value of the text input element (defaults to '')</param>
        public MessageBox Prompt(string title, string msg, JFunction fn, string scope, bool multiline, string value)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.OKCANCEL;
            config.Fn = fn;
            config.MinWidth = Unit.Pixel(250);
            config.Scope = scope;
            config.Prompt = true;
            config.Multiline = multiline;
            config.Value = value;

            return this.Configure(config);
        }
コード例 #14
0
        public MessageBox Confirm(string title, string msg, JFunction fn, string scope)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.YESNO;
            config.Fn = fn;
            config.Scope = scope;
            config.Icon = Icon.QUESTION;

            return this.Configure(config);
        }
コード例 #15
0
        /// <summary>
        /// Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm). If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked will be passed as the only parameter to the callback (could also be the top-right close button).
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="buttonsConfig">A MessageBoxButtonsConfig object for configuring the Text value and JavaScript Handler for each MessageBox Button.</param>
        public MessageBox Confirm(string title, string msg, MessageBoxButtonsConfig buttonsConfig)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.YESNO;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.Icon = Icon.QUESTION;

            return this.Configure(config);
        }
コード例 #16
0
        public MessageBox Alert(string title, string msg, JFunction fn, string scope)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.OK;
            config.Fn = fn;
            config.Scope = scope;

            return this.Configure(config);
        }
コード例 #17
0
        /// <summary>
        /// Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="buttonsConfig">A MessageBoxButtonsConfig object for configuring the Text value and JavaScript Handler for each MessageBox Button.</param>
        /// <param name="scope">(optional) The scope of the callback function</param>
        /// <param name="multiline">(optional) True to create a multiline textbox using the defaultTextHeight property, or the height in pixels to create the textbox (defaults to false / single-line)</param>
        /// <param name="value">(optional) Default value of the text input element (defaults to '')</param>
        public MessageBox Prompt(string title, string msg, MessageBoxButtonsConfig buttonsConfig, string scope, Unit multiline, string value)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.OKCANCEL;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.MinWidth = Unit.Pixel(250);
            config.Scope = scope;
            config.Prompt = true;
            config.MultilineHeight = multiline;
            config.Value = value;

            return this.Configure(config);
        }
コード例 #18
0
        /// <summary>
        /// Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="msg">The message box body text</param>
        /// <param name="buttonsConfig">A MessageBoxButtonsConfig object for configuring the Text value and JavaScript Handler for each MessageBox Button.</param>
        public MessageBox Prompt(string title, string msg, MessageBoxButtonsConfig buttonsConfig)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.OKCANCEL;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.MinWidth = Unit.Pixel(250);
            config.Prompt = true;

            return this.Configure(config);
        }
コード例 #19
0
 public virtual void Show(MessageBoxConfig config)
 {
     this.Configure(config).Show();
 }
コード例 #20
0
        public virtual MessageBox Configure(MessageBoxConfig config)
        {
            this.currentConfig = config;

            return(this);
        }
コード例 #21
0
        public MessageBox Alert(string title, string msg, MessageBoxButtonsConfig buttonsConfig, string scope)
        {
            MessageBoxConfig config = new MessageBoxConfig();
            config.Title = title;
            config.Message = msg;
            config.Buttons = Button.OK;
            config.MessageBoxButtonsConfig = buttonsConfig;
            config.Scope = scope;

            return this.Configure(config);
        }
コード例 #22
0
 public virtual void Show(MessageBoxConfig config)
 {
     this.Configure(config).Show();
 }
コード例 #23
0
        public virtual MessageBox Configure(MessageBoxConfig config)
        {
            this.currentConfig = config;

            return this;
        }