Ejemplo n.º 1
0
        public static FilmObject[] GetFilmsSource(string source)
        {
            List <FilmObject> filmsList = new List <FilmObject>();
            var films = ParseFilmSource(source);

            foreach (var item in films)
            {
                try
                {
                    filmsList.Add(new FilmObject()
                    {
                        Id        = item.id,
                        Name      = item.name,
                        Url       = item.GetUrl,
                        ImageUrl  = item.GetImage,
                        Vote      = RegexParseDouble(item.vote),
                        VoteCount = item.count_vote,
                        ImdbVote  = RegexParseDouble(item.imdb),
                        Countries = item.countries,
                        Actors    = HtmlLogic.GetText(item.actors),
                        Producer  = HtmlLogic.GetText(item.rejisser),
                        EnteredUA = item.entered_ua,
                        Sessions  = GetSessions(item.sessions),
                        AgeLimit  = item.age_limit
                    });
                }
                catch (System.Exception)
                {
                    continue;
                }
            }
            return(filmsList.ToArray());
        }
Ejemplo n.º 2
0
        private static SessionObject[] GetSessions(SessionItem[] sessionItems)
        {
            List <SessionObject> sessionsList = new List <SessionObject>();

            foreach (var item in sessionItems)
            {
                try
                {
                    sessionsList.Add(new SessionObject()
                    {
                        CinemaName   = item.k_name,
                        CinemaAddres = item.k_addr,
                        CinemaUrl    = item.GetUrl,
                        HallName     = item.h_name,
                        Session      = HtmlLogic.GetText(item.sessions)
                    });
                }
                catch (System.Exception)
                {
                    continue;
                }
            }
            return(sessionsList.ToArray());
        }