Beispiel #1
0
        public MovieViewModel(Movie movie) : base()
        {
            ID          = movie.ID;
            RTitle      = movie.RTitle;
            OTitle      = movie.OTitle;
            Year        = movie.Year;
            Note        = movie.Note;
            Description = movie.Description;
            Link        = movie.Link;
            Type        = movie.Type;
            KinopoiskId = movie.KinopoiskId;
            Rating      = new RatingWithKinopoiskViewModel(movie.Rating, movie.KinopoiskRating, movie.IMDBRating);
            States      = new StateItemsViewModel(StatesDict);

            foreach (var s in States.Items)
            {
                var st = movie.States.FirstOrDefault(p => p.Name == s.Key);
                if (st != null)
                {
                    s.Value.IsDone    = true;
                    s.Value.Date      = st.Date;
                    s.Value.IsChanged = false;
                }
            }
            States.GetLastState();

            PrepareViewModel();
        }
Beispiel #2
0
        public MovieViewModel() : base()
        {
            Year   = DateTime.Today.Year;
            Type   = TypeEnum.NA;
            Rating = new RatingWithKinopoiskViewModel();
            States = new StateItemsViewModel(StatesDict);

            PrepareViewModel();
        }
Beispiel #3
0
        public SeasonViewModel(Season season)
        {
            Number   = season.Number;
            Episodes = season.Episodes;
            Note     = season.Note;
            States   = new StateItemsViewModel(StatesDict);

            foreach (var s in States.Items)
            {
                var st = season.States.FirstOrDefault(p => p.Name == s.Key);
                if (st != null)
                {
                    s.Value.IsDone    = true;
                    s.Value.Date      = st.Date;
                    s.Value.IsChanged = false;
                }
            }
            States.GetLastState();

            States.Changed += (o, ea) => IsChanged = true;
            IsChanged       = false;
        }
Beispiel #4
0
        public GameViewModel(Game game) : base()
        {
            ID          = game.ID;
            Title       = game.Title;
            Note        = game.Note;
            Description = game.Description;
            PlayTime    = game.PlayTime;
            Rating      = new RatingViewModel(game.Rating);
            States      = new StateItemsViewModel(StatesDict);
            foreach (var s in States.Items)
            {
                var st = game.States.FirstOrDefault(p => p.Name == s.Key);
                if (st != null)
                {
                    s.Value.IsDone    = true;
                    s.Value.Date      = st.Date;
                    s.Value.IsChanged = false;
                }
            }

            States.GetLastState();

            PrepareViewModel();
        }
Beispiel #5
0
 public GameViewModel() : base()
 {
     Rating = new RatingWithKinopoiskViewModel();
     States = new StateItemsViewModel(StatesDict);
     PrepareViewModel();
 }
Beispiel #6
0
 public SeasonViewModel()
 {
     States          = new StateItemsViewModel(StatesDict);
     States.Changed += (o, ea) => IsChanged = true;
     IsChanged       = false;
 }