Пример #1
0
        private void PrintRandomJokes()
        {
            PrivServJsonFeed.Person person = AskRandomName();
            string category    = AskCategory();
            int    numberJokes = AskNumberJokes();

            PrintJokes(category, person, numberJokes);
        }
Пример #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);
     }
 }
Пример #3
0
        private PrivServJsonFeed.Person AskRandomName()
        {
            PrivServJsonFeed.Person person;

            Print(Questions.WantToUseRandomName);
            if (InputChar().ToLower() == "y")
            {
                person = PrivServJsonFeed.GetName();
            }
            else
            {
                person = new PrivServJsonFeed.Person {
                    FirstName = Resources.Chuck, LastName = Resources.Norris
                };
            }

            return(person);
        }