//Wyszukuje banery i dodaje je odrazu do _BannerList public void SearchForAllBanners(int _seriesID, SeriesDescriptionViewModel main) { string JSON = getReply("https://api.thetvdb.com/series/" + _seriesID + "/images/query?keyType=series"); if (JSON != null) { JObject tvdbSearch = JObject.Parse(JSON); IList <JToken> results = tvdbSearch["data"].Children().ToList(); foreach (JToken result in results) { Poster p = result.ToObject <Poster>(); byte[] array; using (WebClient client = new WebClient()) { array = client.DownloadData(new Uri("http://thetvdb.com/banners/" + p.fileName)); } Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => main.BannerList.Add(array))); Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => main.UpdateBannerList())); } } }
public ChangeBanner(SeriesDescriptionViewModel main) { if (main == null) { throw new ArgumentNullException("TrackedViewModel command"); } this.main = main; }
public AllAboveWatched(SeriesDescriptionViewModel main) { if (main == null) { throw new ArgumentNullException("TrackedViewModel command"); } this.main = main; }