public MasterViewModel()
 {
     m_MoviesDb                = new MoviesDatabase();
     FolderChooserCommand      = new SimpleCommand(ChooseFolder);
     FindMoviesInternetCommand = new SimpleCommand(FindMoviesOnAlloCine);
     m_Movies          = new ObservableCollection <SimpleMovieViewModel>();
     m_ListSimpleMovie = new List <SimpleMovie>();
 }
Beispiel #2
0
 public Kids_CollectionController(MoviesDatabase context)
 {
     _context = context;
 }
Beispiel #3
0
 public ShowsController(MoviesDatabase context)
 {
     _context = context;
 }
Beispiel #4
0
 public CinemasController(MoviesDatabase context)
 {
     _context = context;
 }
Beispiel #5
0
        internal TvProgram(VirtualString html, DateTime day)
        {
            var textHour = html.BetweenS("<strong>Ore ", "</strong>").Split(',');
            var hour     = new TimeSpan(int.Parse(textHour[0]), int.Parse(textHour[1]), 0);
            var date     = day.Add(hour);


            var title = Utils.TextFromHtml(html.Between("<h2", "</h2>").After(">").AsString);

            _grayText = html.Between("<h3", "</h3>").After(">").AsString.Trim().Split('\n').Select(x => x.Trim()).Where(x => !string.IsNullOrEmpty(x)).ToArray();

            if (StringUtils.UpperCaseLettersProportion(title) > 0.3)
            {
                Title = title.ToTitleCase();
            }
            else
            {
                Title = title;
            }

            Date = date;

            if (_grayText.Length > 0)
            {
                var progType = _grayText[0];
                var idx      = progType.IndexOf(" - ");

                if (idx != -1)
                {
                    progType = progType.Substring(0, idx);
                    Genre    = progType;
                }
                Type = GetProgramType(progType);


                if (_grayText.Length >= 2)
                {
                    var yearString = _grayText[1].TryCapture(@"\((\d{4})\)");
                    if (yearString != null)
                    {
                        Year = Convert.ToInt32(yearString);
                    }
                    System.Diagnostics.Debug.WriteLine(_grayText[1]);
                }
            }



            var textID = html.BetweenS("dizionario/", "\"", true);

            if (textID != null)
            {
                _id = textID;

                this.Url = new Uri("http://www.mymovies.it/dizionario/" + _id);
                var myMoviesId = textID.TryCapture(@"recensione\.asp\?id=(\d+)");
                if (myMoviesId != null && MoviesDatabase != null)
                {
                    var movie = MoviesDatabase.GetMovieInfo(int.Parse(myMoviesId));
                    if (movie != null)
                    {
                        Genre     = MoviesDatabase._genres[movie.Value.GenreId];
                        IsItalian = movie.Value.IsItalian;
                        if (this.Type == ProgramType.Unknown)
                        {
                            this.Type = ProgramType.Film;
                        }
                    }
                }
            }

            var ratingText = html.Between("valutazione media tra critica e pubblico: ", " stelle", true);

            if (ratingText != null)
            {
                Rating = Single.Parse(ratingText.AsString.Replace(',', '.'), System.Globalization.NumberFormatInfo.InvariantInfo) / 5;
            }
        }