public void CreateLayout() { var client = new RestClient("https://localhost:8443/sep3"); var request = new RestRequest("movies", Method.GET); var list = client.Execute(request).Content; List <Movie> mlist = JsonConvert.DeserializeObject <List <Movie> >(list); MovieList.movies = mlist; foreach (Movie m in MovieList.movies) { MoviePanel moviePanel = new MoviePanel(); moviePanel.Title = m.title; moviePanel.Link = m.urlFullMovie; moviePanel.Image = m.urlImage; moviePanel.Height = 230; moviePanel.Width = 150; flowLayoutPanel1.Controls.Add(moviePanel); } }
public void CreateLayout() { foreach (Movie m in MovieList.movies) { if (m.category == "Drama") { MoviePanel moviePanel = new MoviePanel(); moviePanel.Title = m.title; moviePanel.Link = m.urlFullMovie; moviePanel.Image = m.urlImage; moviePanel.Height = 230; moviePanel.Width = 150; flowLayoutPanel1.Controls.Add(moviePanel); } } }