Пример #1
0
        //--------------------------------------------------------------------------------

        //--------------------------------------------------------------------------------

        #region ShowTaskDialogBox

        //--------------------------------------------------------------------------------
        public static DialogResult ShowTaskDialogBox(IWin32Window owner,
                                                     string title,
                                                     string mainInstruction,
                                                     string content,
                                                     string expandedInfo,
                                                     string footer,
                                                     string verificationText,
                                                     string radioButtons,
                                                     string commandButtons,
                                                     ETaskDialogButtons buttons,
                                                     ESysIcons mainIcon,
                                                     ESysIcons footerIcon,
                                                     int defaultIndex)

        {
            DialogResult result;

            OnTaskDialogShown?.Invoke(null, EventArgs.Empty);

            using (var td = new frmTaskDialog())
            {
                var display = new DisplayProperties();
                td.Title              = title;
                td.MainInstruction    = mainInstruction;
                td.Content            = content;
                td.ExpandedInfo       = expandedInfo;
                td.Footer             = footer;
                td.RadioButtons       = radioButtons;
                td.CommandButtons     = commandButtons;
                td.Buttons            = buttons;
                td.MainIcon           = mainIcon;
                td.FooterIcon         = footerIcon;
                td.VerificationText   = verificationText;
                td.Width              = display.ScaleWidth(EmulatedFormWidth);
                td.DefaultButtonIndex = defaultIndex;
                td.BuildForm();
                result = td.ShowDialog(owner);

                RadioButtonResult   = td.RadioButtonIndex;
                CommandButtonResult = td.CommandButtonClickedIndex;
                VerificationChecked = td.VerificationCheckBoxChecked;
            }

            OnTaskDialogClosed?.Invoke(null, EventArgs.Empty);
            return(result);
        }
Пример #2
0
        //--------------------------------------------------------------------------------
        public static DialogResult ShowTaskDialogBox(IWin32Window owner,
            string title,
            string mainInstruction,
            string content,
            string expandedInfo,
            string footer,
            string verificationText,
            string radioButtons,
            string commandButtons,
            ETaskDialogButtons buttons,
            ESysIcons mainIcon,
            ESysIcons footerIcon,
            int defaultIndex)
        {
            DialogResult result;
            OnTaskDialogShown?.Invoke(null, EventArgs.Empty);

            using (var td = new frmTaskDialog())
            {
                td.Title = title;
                td.MainInstruction = mainInstruction;
                td.Content = content;
                td.ExpandedInfo = expandedInfo;
                td.Footer = footer;
                td.RadioButtons = radioButtons;
                td.CommandButtons = commandButtons;
                td.Buttons = buttons;
                td.MainIcon = mainIcon;
                td.FooterIcon = footerIcon;
                td.VerificationText = verificationText;
                td.Width = EmulatedFormWidth;
                td.DefaultButtonIndex = defaultIndex;
                td.BuildForm();
                result = td.ShowDialog(owner);

                RadioButtonResult = td.RadioButtonIndex;
                CommandButtonResult = td.CommandButtonClickedIndex;
                VerificationChecked = td.VerificationCheckBoxChecked;
            }

            OnTaskDialogClosed?.Invoke(null, EventArgs.Empty);
            return result;
        }