示例#1
0
        /// <summary>
        /// Shows a dialog with the given message, title, and buttons.
        /// </summary>
        /// <param name="message">The message shown on the dialog.</param>
        /// <param name="title">The dialog's title.</param>
        /// <param name="buttons">The buttons shown on the dialog.</param>
        /// <param name="defResponse">The default dialog response to be
        /// returned if nothing handles the event and sets the response value.</param>
        /// <returns>The response from the dialog.</returns>
        protected virtual DialogResponse ShowMessageDialog(
            string message, string title,
            MessageButtons buttons     = MessageButtons.Ok,
            DialogResponse defResponse = DialogResponse.Other)
        {
            ShowDialogTaskEventArgs args = new ShowDialogTaskEventArgs(
                this, message, title, buttons, defResponse);

            if (ShowDialog != null)
            {
                ShowDialog(this, args);
            }

            return(args.Response);
        }
示例#2
0
文件: Task.cs 项目: Glought/MultiMC
        /// <summary>
        /// Shows a dialog with the given message, title, and buttons.
        /// </summary>
        /// <param name="message">The message shown on the dialog.</param>
        /// <param name="title">The dialog's title.</param>
        /// <param name="buttons">The buttons shown on the dialog.</param>
        /// <param name="defResponse">The default dialog response to be
        /// returned if nothing handles the event and sets the response value.</param>
        /// <returns>The response from the dialog.</returns>
        protected virtual DialogResponse ShowMessageDialog(
			string message, string title, 
			MessageButtons buttons = MessageButtons.Ok,
			DialogResponse defResponse = DialogResponse.Other)
        {
            ShowDialogTaskEventArgs args = new ShowDialogTaskEventArgs(
                this, message, title, buttons, defResponse);

            if (ShowDialog != null)
                ShowDialog(this, args);

            return args.Response;
        }