public override async Task GetCinemaFilmListings(int cinemaID, bool bForce = false)
        {
            string FileName = String.Format(FilmsPerCinemaFileName, cinemaID);
            
            await base.GetCinemaFilmListings(cinemaID, bForce);

            List<FilmHeader> filmheaders = await DeserialiseObject<List<FilmHeader>>(FileName);
            List<FilmInfo> films = new List<FilmInfo>();
            foreach (var fh in filmheaders)
            {
                FilmInfo fi = null;

                if (App.Films.TryGetValue(fh.EDI, out fi))
                {
                    FilmInfo newfi = fi.Clone();

                    if (newfi != null)
                        newfi.Performances = fh.Performances;

                    foreach (var p in newfi.Performances)
                        p.FilmTitle = newfi.Title;

                    films.Add(newfi);
                }
            }
            App.CinemaFilms[cinemaID] = films;
        }
示例#2
0
        public override async Task <bool> GetCinemaFilmListings(int cinemaID, bool bForce = false)
        {
            string FileName = String.Format(FilmsPerCinemaFileName, cinemaID);

            bool downloaded = await base.GetCinemaFilmListings(cinemaID, bForce);

            if (!downloaded)
            {
                return(downloaded);
            }

            List <FilmHeader> filmheaders = await DeserialiseObject <List <FilmHeader> >(FileName);

            List <FilmInfo> films = new List <FilmInfo>();

            foreach (var fh in filmheaders)
            {
                FilmInfo fi = null;

                if (CineworldApplication.Films.TryGetValue(fh.EDI, out fi))
                {
                    FilmInfo newfi = fi.Clone();

                    if (newfi != null)
                    {
                        newfi.Performances = fh.Performances;
                    }

                    foreach (var p in newfi.Performances)
                    {
                        p.FilmTitle = newfi.Title;
                    }

                    films.Add(newfi);
                }
            }
            CineworldApplication.CinemaFilms[cinemaID] = films;

            return(true);
        }