Exemplo n.º 1
0
        public override ConfirmationChoice ShowConfirmationDialog(string message, ConfirmationChoice defaultChoice)
        {
            Control control = this.uiService.GetDialogOwnerWindow() as Control;

            if (control != null && control.InvokeRequired)
            {
                return((ConfirmationChoice)control.Invoke(new WinFormsCommandInteractionHandler.ShowConfirmationDialogDelegate(this.ShowConfirmationDialog), new object[]
                {
                    message,
                    defaultChoice
                }));
            }
            ConfirmationChoice userChoice;

            using (PromptForChoicesDialog promptForChoicesDialog = new PromptForChoicesDialog(message, defaultChoice))
            {
                this.uiService.ShowDialog(promptForChoicesDialog);
                userChoice = promptForChoicesDialog.UserChoice;
            }
            return(userChoice);
        }
        internal PromptForChoicesDialog(string message, ConfirmationChoice defaultChoice) : this()
        {
            this.Message = message;
            switch (defaultChoice)
            {
            case ConfirmationChoice.Yes:
                base.AcceptButton = this.yesButton;
                return;

            case ConfirmationChoice.YesToAll:
                base.AcceptButton = this.yesToAllButton;
                return;

            case ConfirmationChoice.No:
                base.AcceptButton = this.noButton;
                return;

            default:
                base.AcceptButton = this.cancelButton;
                return;
            }
        }
Exemplo n.º 3
0
 public virtual ConfirmationChoice ShowConfirmationDialog(string message, ConfirmationChoice defaultChoice)
 {
     ExTraceGlobals.HostTracer.Information <string>((long)this.GetHashCode(), "CommandInteractionHandler.ShowConfirmationDialog({0})", message);
     return(defaultChoice);
 }
Exemplo n.º 4
0
 public override ConfirmationChoice ShowConfirmationDialog(string message, ConfirmationChoice defaultChoice)
 {
     MrsTracer.Common.Warning("{0}", new object[]
     {
         string.Format("{0} - Automatically Confirmed - {1}", this.prefix, message)
     });
     this.ReportEntries.Add(new ReportEntry(new LocalizedString(message)));
     return(ConfirmationChoice.Yes);
 }