Exemplo n.º 1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            tb2_viewRes.Text = "";
            IEnumerable <string> words = thesaurus.GetWords();

            foreach (var item in words)
            {
                if (!string.IsNullOrWhiteSpace(item))
                {
                    tb2_viewRes.Text += item + Environment.NewLine;
                }
            }
        }
Exemplo n.º 2
0
        private void ListAllWords()
        {
            var words = thesaurus.GetWords();

            if (words.Any())
            {
                foreach (string word in words)
                {
                    Console.WriteLine(word);
                }
            }
            else
            {
                Console.WriteLine("The thesaurus does not contain any words! Try adding some");
            }

            Console.ReadKey();
        }
 public IEnumerable <string> Get()
 {
     return(thesaurusService.GetWords());
 }