コード例 #1
0
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="showCheckBox">Whether or not we should display a checkbox</param>
 /// <param name="checkBoxLabel">The label of the checkbox</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param>int focusedButtonIndex,
 public ModalViewModel(string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex)
 {
     FocusedButtonIndex = focusedButtonIndex;
     ModalResult        = App.ModalResult.Cancel;
     Buttons            = new List <ModalButton>();
     CheckBoxLabel      = checkBoxLabel;
     ShowCheckBox       = showCheckBox;
     Description        = description;
     Icon  = messageBoxIcon;
     Title = title;
 }
コード例 #2
0
 /// <summary>
 /// Get system icon for MessageBoxIcon.
 /// </summary>
 /// <param name="icon">The MessageBoxIcon value.</param>
 /// <returns>SystemIcon type Icon.</returns>
 public static Icon GetMessageBoxIcon( CustomMsgBoxIcon icon )
 {
     switch( icon )
     {
         case CustomMsgBoxIcon.Information:
             return SystemIcons.Information;
         case CustomMsgBoxIcon.Warning:
             return SystemIcons.Warning;
         case CustomMsgBoxIcon.Error:
             return SystemIcons.Error;
         case CustomMsgBoxIcon.Question:
             return SystemIcons.Question;
         default:
             return null;
     }
 }
コード例 #3
0
        /// <summary>
        /// Get system icon for MessageBoxIcon.
        /// </summary>
        /// <param name="icon">The MessageBoxIcon value.</param>
        /// <returns>SystemIcon type Icon.</returns>
        public static Icon GetMessageBoxIcon(CustomMsgBoxIcon icon)
        {
            switch (icon)
            {
            case CustomMsgBoxIcon.Information:
                return(SystemIcons.Information);

            case CustomMsgBoxIcon.Warning:
                return(SystemIcons.Warning);

            case CustomMsgBoxIcon.Error:
                return(SystemIcons.Error);

            case CustomMsgBoxIcon.Question:
                return(SystemIcons.Question);

            default:
                return(null);
            }
        }
コード例 #4
0
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 public ModalViewModel(string title, string description, CustomMsgBoxIcon messageBoxIcon)
     : this(title, description, false, "", messageBoxIcon, 0)
 {
 }
コード例 #5
0
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 /// /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param>
 public ModalViewModel(string title, string description, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex)
     : this(title, description, false, "", messageBoxIcon, focusedButtonIndex)
 {
 }
コード例 #6
0
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="showCheckBox">Whether or not we should display a checkbox</param>
 /// <param name="checkBoxLabel">The label of the checkbox</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 public ModalViewModel(string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon)
     : this(title, description, showCheckBox, checkBoxLabel, messageBoxIcon, 0)
 {
 }
コード例 #7
0
ファイル: ModalViewModel.cs プロジェクト: Nementon/ck-desktop
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 public ModalViewModel( string title, string description, CustomMsgBoxIcon messageBoxIcon )
     : this( title, description, false, "", messageBoxIcon, 0 )
 {
 }
コード例 #8
0
ファイル: ModalViewModel.cs プロジェクト: Nementon/ck-desktop
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 /// /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param>
 public ModalViewModel( string title, string description, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex )
     : this( title, description, false, "", messageBoxIcon, focusedButtonIndex )
 {
 }
コード例 #9
0
ファイル: ModalViewModel.cs プロジェクト: Nementon/ck-desktop
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="showCheckBox">Whether or not we should display a checkbox</param>
 /// <param name="checkBoxLabel">The label of the checkbox</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 public ModalViewModel( string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon )
     : this( title, description, showCheckBox, checkBoxLabel, messageBoxIcon, 0 )
 {
 }
コード例 #10
0
ファイル: ModalViewModel.cs プロジェクト: Nementon/ck-desktop
 /// <summary>
 /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>.
 /// </summary>
 /// <param name="title">Title of the modal</param>
 /// <param name="description">Description of the modal</param>
 /// <param name="showCheckBox">Whether or not we should display a checkbox</param>
 /// <param name="checkBoxLabel">The label of the checkbox</param>
 /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param>
 /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param>int focusedButtonIndex, 
 public ModalViewModel( string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex )
 {
     FocusedButtonIndex = focusedButtonIndex;
     ModalResult = App.ModalResult.Cancel;
     Buttons = new List<ModalButton>();
     CheckBoxLabel = checkBoxLabel;
     ShowCheckBox = showCheckBox;
     Description = description;
     Icon = messageBoxIcon;
     Title = title;
 }