Beispiel #1
0
 private void PrintCategories()
 {
     Print(Questions.CategoryTitle);
     foreach (var item in NorrisJsonFeed.GetCategories())
     {
         Print(item);
     }
     Print(string.Empty);
 }
Beispiel #2
0
 private void PrintJokes(string category, PrivServJsonFeed.Person person, int numberJokes)
 {
     foreach (var item in NorrisJsonFeed.GetRandomJokes(numberJokes, category))
     {
         string newItem = item.Replace(Resources.Chuck, person.FirstName, StringComparison.CurrentCultureIgnoreCase);
         newItem = newItem.Replace(Resources.Norris, person.LastName, StringComparison.CurrentCultureIgnoreCase);
         Print(newItem);
     }
 }
Beispiel #3
0
        private string SpecifyCategory()
        {
            while (true)
            {
                Print(Questions.EnterCategory);

                string category = Input();

                if (NorrisJsonFeed.GetCategories().Contains(category))
                {
                    return(category);
                }
                else
                {
                    Print(Questions.InvalidCategory.Replace("category", category));
                    PrintCategories();
                }
            }
        }