public static void AddMoviesByCinema(GoogleMovies.Cinema cinema) { Movies.Clear(); var ml = GoogleMovies.GoogleMovies.GetMoviesByCinema(cinema); foreach (var m in ml) { var item = new ListItem { AdditionalProperties = { [NAME] = m.Title } }; item.SetLabel("Name", m.Title); for (var i = 0; i <= 3; i++) { item.SetLabel("Day" + Convert.ToString(i), ShowtimesByCinemaMovieDay(cinema, m, i).Substring(0, 10)); item.SetLabel("Day" + Convert.ToString(i) + "_Time", ShowtimesByCinemaMovieDay(cinema, m, i).Substring(12)); } var mm = SETTINGS_MANAGER.Load <Movies>().MovieList; foreach (var t in mm) { if (t.Title == m.Title) { item.SetLabel("Poster", t.Poster); item.SetLabel("Picture", t.Picture); item.SetLabel("Description", t.Description); item.SetLabel("Year", t.Year); item.SetLabel("AgeLimit", t.AgeLimit); item.SetLabel("Genre", t.Genre); item.AdditionalProperties[TRAILER] = t.Trailer; } } item.SetLabel("Duration", m.Runtime); Movies.Add(item); } Movies.FireChange(); }
private static string ShowtimesByCinemaMovieDay(GoogleMovies.Cinema cinema, Movie movie, int day) { var st = GoogleMovies.GoogleMovies.GetShowTimesByCinemaAndMovieAndDay(cinema, movie, day).Aggregate("", (current, s) => current + (s + " | ")); return(GoogleMovies.GoogleMovies.GetNewDay(day) + ": " + st); }