Example #1
0
 private void SetFlag(NativeMethods.TASKDIALOG_FLAGS flag, bool value)
 {
     if (value)
     {
         _flags |= flag;
     }
     else
     {
         _flags &= ~flag;
     }
 }
Example #2
0
        private void ApplyOptionConfiguration(NativeMethods.TASKDIALOGCONFIG dialogConfig)
        {
            // Handle options - start with no options set
            NativeMethods.TASKDIALOG_FLAGS options = NativeMethods.TASKDIALOG_FLAGS.NONE;
            if (cancelable)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
            }
            if (checkBoxChecked.HasValue && checkBoxChecked.Value)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_VERIFICATION_FLAG_CHECKED;
            }
            if (hyperlinksEnabled)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS;
            }
            if (expanded)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_EXPANDED_BY_DEFAULT;
            }
            if (Tick != null)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_CALLBACK_TIMER;
            }
            if (startupLocation == TaskDialogStartupLocation.CenterOwner)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_POSITION_RELATIVE_TO_WINDOW;
            }

            // Note: no validation required, as we allow this to be set even if there
            // is no expanded information text because that could be added later.
            // Default for Win32 API is to expand into (and after) the content area.
            if (expansionMode == TaskDialogExpandedInformationLocation.ExpandFooter)
            {
                options |= NativeMethods.TASKDIALOG_FLAGS.TDF_EXPAND_FOOTER_AREA;
            }

            // Finally, apply options to config
            dialogConfig.dwFlags = options;
        }
Example #3
0
 public void Reset()
 {
     WindowTitle      = null;
     MainInstruction  = null;
     Content          = null;
     CommonButtons    = 0;
     MainIcon         = TaskDialogIcon.None;
     CustomMainIcon   = null;
     FooterIcon       = TaskDialogIcon.None;
     CustomFooterIcon = null;
     Buttons.Clear();
     RadioButtons.Clear();
     _flags               = 0;
     DefaultButton        = 0;
     DefaultRadioButton   = 0;
     VerificationText     = null;
     ExpandedInformation  = null;
     ExpandedControlText  = null;
     CollapsedControlText = null;
     Footer               = null;
     Callback             = null;
     CallbackData         = null;
     Width = 0;
 }
Example #4
0
 private bool IsOptionSet(NativeMethods.TASKDIALOG_FLAGS flag)
 {
     return((nativeDialogConfig.dwFlags & flag) == flag);
 }
Example #5
0
 private void SetFlag(NativeMethods.TASKDIALOG_FLAGS flag, bool value)
 {
     if (value)
         _flags |= flag;
     else
         _flags &= ~flag;
 }
Example #6
0
 public void Reset()
 {
     WindowTitle = null;
     MainInstruction = null;
     Content = null;
     CommonButtons = 0;
     MainIcon = TaskDialogIcon.None;
     CustomMainIcon = null;
     FooterIcon = TaskDialogIcon.None;
     CustomFooterIcon = null;
     Buttons.Clear();
     RadioButtons.Clear();
     _flags = 0;
     DefaultButton = 0;
     DefaultRadioButton = 0;
     VerificationText = null;
     ExpandedInformation = null;
     ExpandedControlText = null;
     CollapsedControlText = null;
     Footer = null;
     Callback = null;
     CallbackData = null;
     Width = 0;
 }