private async Task loadAnimeInfo() { await Task.Run(() => { info = Jikan.GetInfo(textBox_AnimeID.Text); episodes = Jikan.GetEpisodes(textBox_AnimeID.Text); if (info != null && info.ImageURL != null) { using (System.Net.WebClient webClient = new System.Net.WebClient()) { using (Stream stream = webClient.OpenRead(info.ImageURL)) { pictureBox1.Image = Image.FromStream(stream); } } } }); }
private void doSearch() { searchResults = Jikan.Search(textBox_SearchTerm.Text); dataGridView1.Rows.Clear(); if (searchResults == null) { return; } foreach (Jikan.SearchResult result in searchResults) { string startYear = "-"; if (result.StartDate != null) { startYear = DateTime.Parse(result.StartDate, null, System.Globalization.DateTimeStyles.RoundtripKind).Year.ToString(); } dataGridView1.Rows.Add(result.Title, result.EpisodeCount, startYear); } }