/// <summary>
        /// Create a CustomMessageDialog
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Main message of the dialog</param>
        /// <param name="appInformation">App information for restricting number of dialogs</param>
        /// <param name="dialogButtons">A value that indicaties the button or buttons to display</param>
        /// <param name="buttonOrientation">Show buttons on a horizntal row or vertical below each other</param>
        /// <param name="messageDialogImage">Extra image to display in top of dialog to the user. Default no image</param>
        public CustomMessageDialog(string title, string message, AppInformation appInformation,
                                   IEnumerable <DialogButton> dialogButtons, Orientation buttonOrientation = Orientation.Horizontal,
                                   MessageDialogImage messageDialogImage = MessageDialogImage.None)
        {
            _title             = title;
            _message           = message;
            _appInformation    = appInformation;
            _buttonOrientation = buttonOrientation;
            _buttons           = new List <DialogButton>(dialogButtons);

            // Set default result to custom when using defined buttons
            this.DialogResult = MessageDialogResult.Custom;

            SetDialogImage(messageDialogImage);
        }
示例#2
0
        /// <summary>
        /// Create a CustomInputDialog
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Message above the input control</param>
        /// <param name="appInformation">App information for restricting number of dialogs</param>
        /// <param name="settings">Dialog settings to manipulate the dialog look and behavior</param>
        public CustomInputDialog(string title, string message, AppInformation appInformation,
                                 CustomInputDialogSettings settings = null)
        {
            _title          = title;
            _message        = message;
            _appInformation = appInformation;

            // Set the settings. If none specfied, create a default set
            _settings = settings ?? new CustomInputDialogSettings()
            {
                DefaultText = String.Empty,
                IgnoreExtensionInSelection = false,
                SelectDefaultText          = false,
                OverrideCancelButtonText   = String.Empty,
                OverrideOkButtonText       = String.Empty
            };
        }
        /// <summary>
        /// Create a CustomMessageDialog
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Main message of the dialog</param>
        /// <param name="appInformation">App information for restricting number of dialogs</param>
        /// <param name="messageDialogImage">Extra image to display in top of dialog to the user. Default no image</param>
        public CustomMessageDialog(string title, string message, AppInformation appInformation,
                                   MessageDialogImage messageDialogImage = MessageDialogImage.None)
        {
            _title          = title;
            _message        = message;
            _appInformation = appInformation;

            // Default orientatien is vertical
            _buttonOrientation = Orientation.Vertical;

            // Create a default Ok button for this minimal dialog
            _buttons = new List <DialogButton> {
                DialogButton.GetOkButton()
            };

            // Set default result to Cancel or No
            this.DialogResult = MessageDialogResult.CancelNo;

            SetDialogImage(messageDialogImage);
        }
        /// <summary>
        /// Create a CustomMessageDialog
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Main message of the dialog</param>
        /// <param name="appInformation">App information for restricting number of dialogs</param>
        /// <param name="dialogButtons">A value that indicaties the button or buttons to display</param>
        /// <param name="messageDialogImage">Extra image to display in top of dialog to the user. Default no image</param>
        public CustomMessageDialog(string title, string message, AppInformation appInformation,
                                   MessageDialogButtons dialogButtons, MessageDialogImage messageDialogImage = MessageDialogImage.None)
        {
            _title          = title;
            _message        = message;
            _appInformation = appInformation;

            // Default orientatien is horizontal when using button(s) enumeration
            _buttonOrientation = Orientation.Horizontal;
            _buttons           = new List <DialogButton>();

            // Create buttons defined in the constructor
            switch (dialogButtons)
            {
            case MessageDialogButtons.Ok:
                _buttons.Add(DialogButton.GetOkButton());
                break;

            case MessageDialogButtons.OkCancel:
                _buttons.Add(DialogButton.GetOkButton());
                _buttons.Add(DialogButton.GetCancelButton());
                break;

            case MessageDialogButtons.YesNo:
                _buttons.Add(DialogButton.GetYesButton());
                _buttons.Add(DialogButton.GetNoButton());
                break;

            default:
                throw new ArgumentOutOfRangeException("dialogButtons", dialogButtons, null);
            }

            // Set default result to Cancel or No
            this.DialogResult = MessageDialogResult.CancelNo;

            SetDialogImage(messageDialogImage);
        }