Beispiel #1
0
        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;
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 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;
 }
Beispiel #8
0
 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;
 }