コード例 #1
0
        private async void PopulateCatagories()
        {
            IEnumerable <String> categories = await ChuckNorrisClient.GetCategories();

            CboCategory.DataSource    = categories;
            CboCategory.DisplayMember = nameof(categories);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: hm9811/ChuckNorris-DotNetAPI
        private async void Form1_Load(object sender, EventArgs e)
        {
            string[] choice = (string[])await ChuckNorrisClient.GetCategories();

            categoriesCbox.Items.AddRange(choice);

            categoriesCbox.SelectedIndex = 0;
        }
コード例 #3
0
        private async void PopulateCategoriesAsync()
        {
            var categories = await ChuckNorrisClient.GetCategories();

            foreach (var category in categories)
            {
                filterCbx.Items.Add(category);
            }
        }
コード例 #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);
            }
        }
コード例 #5
0
        public async void GetCategoryList()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

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

            foreach (var cata in catagoryList)
            {
                CmbxCategories.Items.Add(cata);
            }
        }
コード例 #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);
            }
        }
コード例 #8
0
        private async void getCategories()
        {
            IEnumerable <String> categories = await ChuckNorrisClient.GetCategories();

            foreach (var category in categories)
            {
                CategoryBox.Items.Add(category);
            }
        }
コード例 #9
0
        private async void Get_Categories()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var cat in categories)
            {
                CmbCategories.Items.Add(cat);
            }
        }
コード例 #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);
            }
        }
コード例 #11
0
        public async void PopulateComboBox()
        {
            var c = await ChuckNorrisClient.GetCategories();

            foreach (var categories in c)
            {
                cmbCategories.Items.Add(categories);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #14
0
ファイル: Form1.cs プロジェクト: PKJrod/ChuckNorris-DotNetAPI
        public async Task populateCategories()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            foreach (var list in categories)
            {
                categoriesTxt.Items.Add(list);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #17
0
        private async void populateForm()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

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


            foreach (string s in list)
            {
                cateBox.Items.Add(s);
            }
        }
コード例 #19
0
        public Form1()
        {
            IEnumerable <string> categories = Task.Run(() => ChuckNorrisClient.GetCategories()).Result;

            InitializeComponent();
            foreach (var cat in categories)
            {
                cBoxTypes.Items.Add(cat);
            }
            cBoxTypes.SelectedIndex = 0;
        }
コード例 #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;
        }
コード例 #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();
        }
コード例 #22
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            string[] Categories = (await ChuckNorrisClient.GetCategories()).ToArray();

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

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

            categoriesComboBox.DataSource = categories;
        }
コード例 #28
0
        private async void PopulateCategoriesList()
        {
            IEnumerable <string> categories = await ChuckNorrisClient.GetCategories();

            cboCategories.DataSource = categories.ToList();
        }
コード例 #29
0
 public Form1()
 {
     InitializeComponent();
     comboBox1.Items.Add(ChuckNorrisClient.GetCategories());
 }
コード例 #30
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            var list = await ChuckNorrisClient.GetCategories();

            comboBox1.DataSource = list;
        }