protected override void ExecuteTask() { string Answer; if (this.ShowDialog) { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); foreach (String Choice in this.Options) { Questioner.AddChoice(Choice); } Questioner.StateQuestion(this.Question); if (!String.IsNullOrEmpty(this.Caption)) { Questioner.SetCaption(this.Caption); } Questioner.ShowDialog(); Answer = Questioner.GetAnswer(); } else { Log(Level.Info, this.Question); Answer = Console.ReadLine(); } this.Properties[this.AnswerProperty] = Answer; }
protected override void ExecuteTask() { string Answer = string.Empty; if (this.ShowDialog) { if (this.DialogMode == Mode.Options) { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); int OptionCount = 0; foreach (String Choice in this.Options) { ++OptionCount; if (OptionCount > 6) { break; } Questioner.AddChoice(Choice); } Questioner.StateQuestion(this.Question); if (!String.IsNullOrEmpty(this.Caption)) { Questioner.SetCaption(this.Caption); } Questioner.ShowDialog(); Answer = Questioner.GetAnswer(); } else if (this.DialogMode == Mode.FreeText) { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); Questioner.SetFreeTextMode(); Questioner.StateQuestion(this.Question); if (!String.IsNullOrEmpty(this.Caption)) { Questioner.SetCaption(this.Caption); } Questioner.ShowDialog(); Answer = Questioner.GetAnswer(); } } else { Log(Level.Info, this.Question); Answer = Console.ReadLine(); } this.Properties[this.AnswerProperty] = Answer; }
protected override void ExecuteTask() { string Answer = string.Empty; if (this.ShowDialog) { if (this.DialogMode == Mode.Options) { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); int OptionCount = 0; foreach (String Choice in this.Options) { ++OptionCount; if (OptionCount > 6) break; Questioner.AddChoice(Choice); } Questioner.StateQuestion(this.Question); if (!String.IsNullOrEmpty(this.Caption)) Questioner.SetCaption(this.Caption); Questioner.ShowDialog(); Answer = Questioner.GetAnswer(); } else if (this.DialogMode == Mode.FreeText) { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); Questioner.SetFreeTextMode(); Questioner.StateQuestion(this.Question); if (!String.IsNullOrEmpty(this.Caption)) Questioner.SetCaption(this.Caption); Questioner.ShowDialog(); Answer = Questioner.GetAnswer(); } } else { Log(Level.Info, this.Question); Answer = Console.ReadLine(); } this.Properties[this.AnswerProperty] = Answer; }
protected override void ExecuteTask() { string Answer; if (this.ShowDialog) { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); foreach (String Choice in this.Options) { Questioner.AddChoice(Choice); } Questioner.StateQuestion(this.Question); if (!String.IsNullOrEmpty(this.Caption)) Questioner.SetCaption(this.Caption); Questioner.ShowDialog(); Answer = Questioner.GetAnswer(); } else { Log(Level.Info, this.Question); Answer = Console.ReadLine(); } this.Properties[this.AnswerProperty] = Answer; }