Esempio n. 1
0
        private async void PopulateCatagories()
        {
            IEnumerable <String> categories = await ChuckNorrisClient.GetCategories();

            CboCategory.DataSource    = categories;
            CboCategory.DisplayMember = nameof(categories);
        }
Esempio n. 2
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            string[] choice = (string[])await ChuckNorrisClient.GetCategories();

            categoriesCbox.Items.AddRange(choice);

            categoriesCbox.SelectedIndex = 0;
        }
Esempio n. 3
0
        private async void PopulateCategoriesAsync()
        {
            var categories = await ChuckNorrisClient.GetCategories();

            foreach (var category in categories)
            {
                filterCbx.Items.Add(category);
            }
        }
Esempio n. 4
0
        private async void frmGetJoke_LoadAsync(object sender, EventArgs e)
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var cat in categories)
            {
                cbxCategories.Items.Add(cat);
            }
        }
Esempio n. 5
0
        public async void GetCategoryList()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (string c in categories)
            {
                cboxCategories.Items.Add(c);
            }
        }
Esempio n. 6
0
        private async void PopCats()
        {
            IEnumerable <string> catagoryList = await ChuckNorrisClient.GetCategories();

            foreach (var cata in catagoryList)
            {
                CmbxCategories.Items.Add(cata);
            }
        }
Esempio n. 7
0
        private async void ChuckNorrisForm_Load(object sender, EventArgs e)
        {
            IEnumerable <string> getJokeCategories = await ChuckNorrisClient.GetCategories();

            foreach (string category in getJokeCategories)
            {
                jokeComboBox.Items.Add(category);
            }
        }
Esempio n. 8
0
        private async void getCategories()
        {
            IEnumerable <String> categories = await ChuckNorrisClient.GetCategories();

            foreach (var category in categories)
            {
                CategoryBox.Items.Add(category);
            }
        }
        private async void Get_Categories()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var cat in categories)
            {
                CmbCategories.Items.Add(cat);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Populate the Combo Box with the joke categories
        /// </summary>
        private async void PopulateComboBox()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (string category in categories)
            {
                CategoryCBox.Items.Add(category);
            }
        }
Esempio n. 11
0
        public async void PopulateComboBox()
        {
            var c = await ChuckNorrisClient.GetCategories();

            foreach (var categories in c)
            {
                cmbCategories.Items.Add(categories);
            }
        }
Esempio n. 12
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (string category in categories)
            {
                categoriesCbx.Items.Add(category);
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Populates comboBox with categories supplied
        /// by ChuckNorrisClientClasses
        /// </summary>
        private async void PopulateCategoriesList()
        {
            IEnumerable <string> categoryString = await ChuckNorrisClient.GetCategories();

            foreach (var s in categoryString)
            {
                cmbxCategories.Items.Add(s);
            }
        }
Esempio n. 14
0
        public async Task populateCategories()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var list in categories)
            {
                categoriesTxt.Items.Add(list);
            }
        }
Esempio n. 15
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            IEnumerable <string> category = await ChuckNorrisClient.GetCategories();

            foreach (var c in category)
            {
                cboGetCategory.Items.Add(c);
            }
        }
Esempio n. 16
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            var categories = await ChuckNorrisClient.GetCategories();

            foreach (var c in categories)
            {
                categorieCmbBox.Items.Add(c);
            }
        }
Esempio n. 17
0
        private async void populateForm()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var cat in categories)
            {
                cboCatagoies.Items.Add(cat);
            }
        }
Esempio n. 18
0
        private async void PopulateCategories()
        {
            IEnumerable <string> list = await ChuckNorrisClient.GetCategories();


            foreach (string s in list)
            {
                cateBox.Items.Add(s);
            }
        }
        public Form1()
        {
            IEnumerable <string> categories = Task.Run(() => ChuckNorrisClient.GetCategories()).Result;

            InitializeComponent();
            foreach (var cat in categories)
            {
                cBoxTypes.Items.Add(cat);
            }
            cBoxTypes.SelectedIndex = 0;
        }
Esempio n. 20
0
        private async void PopulateCategories()
        {
            ddlCategories.Items.Add("Any");
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (string str in categories)
            {
                ddlCategories.Items.Add(str);
            }
            ddlCategories.SelectedIndex = 0;
        }
Esempio n. 21
0
        private static async Task Run()
        {
            //get random joke test
            WriteLine("Getting a single joke**********************");
            Joke j = await ChuckNorrisClient.GetRandomJoke();

            WriteLine($"{j.Id}:{j.JokeText}\n\n{string.Join(", ", j.Categories)}");

            //get categories
            WriteLine("Getting categories****************************");
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var cat in categories)
            {
                WriteLine(cat);
            }

            //print specific joke
            WriteLine("Getting specific joke***************************");
            Joke j2 = await ChuckNorrisClient.GetJokeById(2);

            WriteLine(j2.JokeText);

            //retrieve joke that doesn't exist
            WriteLine("Retrieving non-existent joke********************");
            try
            {
                Joke j3 = await ChuckNorrisClient.GetJokeById(20000000);
            }
            catch (NoSuchQuoteException)
            {
                WriteLine("There is no joke/quote with that id");
            }


            ReadKey();
        }
Esempio n. 22
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            string[] Categories = (await ChuckNorrisClient.GetCategories()).ToArray();

            listBox1.Items.AddRange(Categories);
        }
Esempio n. 23
0
 private async void PopulateCategoriesAsync()
 {
     cboCategories.DataSource = await ChuckNorrisClient.GetCategories();
 }
Esempio n. 24
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            jokeCategoriesCmbBox.DataSource = categories;
        }
Esempio n. 25
0
 private IEnumerable <string> GetCategories()
 {
     return(ChuckNorrisClient.GetCategories().Result);
 }
Esempio n. 26
0
 private async static Task <IEnumerable <string> > GetCategories()
 {
     return(await ChuckNorrisClient.GetCategories());
 }
Esempio n. 27
0
        private async void JokeForm_LoadAsync(object sender, EventArgs e)
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            categoriesComboBox.DataSource = categories;
        }
Esempio n. 28
0
        private async void PopulateCategoriesList()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            cboCategories.DataSource = categories.ToList();
        }
 public Form1()
 {
     InitializeComponent();
     comboBox1.Items.Add(ChuckNorrisClient.GetCategories());
 }
        private async void Form1_Load(object sender, EventArgs e)
        {
            var list = await ChuckNorrisClient.GetCategories();

            comboBox1.DataSource = list;
        }