Exemple #1
0
 public static string PromptForKeyword(string promptString)
 {
     var prompt = new KeywordPrompt(promptString);
     while (true)
     {
         Console.Write("{0}:", promptString);
         var resp = Console.ReadLine();
         string ret;
         if (prompt.TryMatch(resp, out ret))
             return ret;
     }
 }
Exemple #2
0
        public static string PromptForKeyword(string promptString)
        {
            var prompt = new KeywordPrompt(promptString);

            while (true)
            {
                Console.Write("{0}:", promptString);
                var    resp = Console.ReadLine();
                string ret  = null;
                if (prompt.TryMatch(resp, ref ret))
                {
                    return(ret);
                }
            }
        }