Exemplo n.º 1
0
        internal static VistaTaskDialogCommonButtons ConvertCommonButtons(TaskDialogCommonButtons commonButtons)
        {
            VistaTaskDialogCommonButtons vtdCommonButtons = VistaTaskDialogCommonButtons.None;

            switch (commonButtons)
            {
            default:
            case TaskDialogCommonButtons.None:
                vtdCommonButtons = VistaTaskDialogCommonButtons.None;
                break;

            case TaskDialogCommonButtons.Close:
                vtdCommonButtons = VistaTaskDialogCommonButtons.Close;
                break;

            case TaskDialogCommonButtons.OKCancel:
                vtdCommonButtons = VistaTaskDialogCommonButtons.OK | VistaTaskDialogCommonButtons.Cancel;
                break;

            case TaskDialogCommonButtons.RetryCancel:
                vtdCommonButtons = VistaTaskDialogCommonButtons.Retry | VistaTaskDialogCommonButtons.Cancel;
                break;

            case TaskDialogCommonButtons.YesNo:
                vtdCommonButtons = VistaTaskDialogCommonButtons.Yes | VistaTaskDialogCommonButtons.No;
                break;

            case TaskDialogCommonButtons.YesNoCancel:
                vtdCommonButtons = VistaTaskDialogCommonButtons.Yes | VistaTaskDialogCommonButtons.No | VistaTaskDialogCommonButtons.Cancel;
                break;
            }

            return(vtdCommonButtons);
        }
Exemplo n.º 2
0
        internal static TaskDialogButtonData ConvertCommonButton(VistaTaskDialogCommonButtons commonButton, System.Windows.Input.ICommand command = null, bool isDefault = false, bool isCancel = false)
        {
            int id = 0;

            switch (commonButton)
            {
            default:
            case VistaTaskDialogCommonButtons.None:
                id = (int)TaskDialogSimpleResult.None;
                break;

            case VistaTaskDialogCommonButtons.OK:
                id = (int)TaskDialogSimpleResult.Ok;
                break;

            case VistaTaskDialogCommonButtons.Yes:
                id = (int)TaskDialogSimpleResult.Yes;
                break;

            case VistaTaskDialogCommonButtons.No:
                id = (int)TaskDialogSimpleResult.No;
                break;

            case VistaTaskDialogCommonButtons.Cancel:
                id = (int)TaskDialogSimpleResult.Cancel;
                break;

            case VistaTaskDialogCommonButtons.Retry:
                id = (int)TaskDialogSimpleResult.Retry;
                break;

            case VistaTaskDialogCommonButtons.Close:
                id = (int)TaskDialogSimpleResult.Close;
                break;
            }

            return(new TaskDialogButtonData(id, "_" + commonButton.ToString(), command, isDefault, isCancel));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Resets the Task Dialog to the state when first constructed, all properties set to their default value.
 /// </summary>
 public void Reset()
 {
     this.windowTitle = null;
     this.mainInstruction = null;
     this.content = null;
     this.commonButtons = 0;
     this.mainIcon = VistaTaskDialogIcon.None;
     this.customMainIcon = null;
     this.footerIcon = VistaTaskDialogIcon.None;
     this.customFooterIcon = null;
     this.buttons = new VistaTaskDialogButton[0];
     this.radioButtons = new VistaTaskDialogButton[0];
     this.flags = 0;
     this.defaultButton = 0;
     this.defaultRadioButton = 0;
     this.verificationText = null;
     this.expandedInformation = null;
     this.expandedControlText = null;
     this.collapsedControlText = null;
     this.footer = null;
     this.callback = null;
     this.callbackData = null;
     this.width = 0;
 }
Exemplo n.º 4
0
        internal static TaskDialogButtonData ConvertCommonButton(VistaTaskDialogCommonButtons commonButton, System.Windows.Input.ICommand command = null, bool isDefault = false, bool isCancel = false)
        {
            int id = 0;

            switch (commonButton)
            {
                default:
                case VistaTaskDialogCommonButtons.None:
                    id = (int)TaskDialogSimpleResult.None;
                    break;
                case VistaTaskDialogCommonButtons.OK:
                    id = (int)TaskDialogSimpleResult.Ok;
                    break;
                case VistaTaskDialogCommonButtons.Yes:
                    id = (int)TaskDialogSimpleResult.Yes;
                    break;
                case VistaTaskDialogCommonButtons.No:
                    id = (int)TaskDialogSimpleResult.No;
                    break;
                case VistaTaskDialogCommonButtons.Cancel:
                    id = (int)TaskDialogSimpleResult.Cancel;
                    break;
                case VistaTaskDialogCommonButtons.Retry:
                    id = (int)TaskDialogSimpleResult.Retry;
                    break;
                case VistaTaskDialogCommonButtons.Close:
                    id = (int)TaskDialogSimpleResult.Close;
                    break;
            }

            return new TaskDialogButtonData(id, "_" + commonButton.ToString(), command, isDefault, isCancel);
        }