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; }
public void Test2() { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); Questioner.SetFreeTextMode(); Questioner.StateQuestion(string.Format("{0}{1}{0}", "I really have a lot to say.", Environment.NewLine)); Questioner.ShowDialog(); string Answer = Questioner.GetAnswer(); Console.WriteLine(Answer); }
public void Test() { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); Questioner.AddChoice("Install"); Questioner.AddChoice("Don't Install"); Questioner.AddChoice("Quit"); Questioner.StateQuestion(string.Format("{0}{1}{0}", "I really have a lot to say.", Environment.NewLine)); Questioner.ShowDialog(); string Answer = Questioner.GetAnswer(); Console.WriteLine(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; }
public void Test2() { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); Questioner.SetFreeTextMode(); Questioner.StateQuestion(string.Format("{0}{1}{0}", "I really have a lot to say.", Environment.NewLine)); Questioner.ShowDialog(); string Answer = Questioner.GetAnswer(); Console.WriteLine(Answer); }
public void Test() { Ask.AskQuestion Questioner = new CIFactory.NAnt.Tasks.Ask.AskQuestion(); Questioner.AddChoice("Install"); Questioner.AddChoice("Don't Install"); Questioner.AddChoice("Quit"); Questioner.StateQuestion(string.Format("{0}{1}{0}", "I really have a lot to say.", Environment.NewLine)); Questioner.ShowDialog(); string Answer = Questioner.GetAnswer(); Console.WriteLine(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; }