示例#1
0
        public void AddMovie(Movie movie)
        {
            movie.SequencialNo = _movies.Count;
            Add(movie);

            if (!_queue.Queue[_queue.QueueCount - 1].IsDummy) { return; }

            var lastMovie = _queue.Queue.LastOrDefault(m => !m.IsDummy);
            var index = _queue.Queue.IndexOf(lastMovie);
            var nmvm = new MovieBriefViewModel(movie, _eventAggregator);
            var dummyView = _queue.Queue[index + 1];
            nmvm.Scale = dummyView.Scale;
            nmvm.NewScale = dummyView.NewScale;
            nmvm.CenterX = dummyView.CenterX;
            nmvm.NewCenterX = dummyView.NewCenterX;
            nmvm.CenterY = dummyView.CenterY;
            nmvm.NewCenterY = dummyView.NewCenterY;
            nmvm.Opacity = dummyView.Opacity;
            nmvm.NewOpacity = dummyView.NewOpacity;
            nmvm.ZIndex = dummyView.ZIndex;
            nmvm.NewZIndex = dummyView.NewZIndex;

            _queue.Queue[index + 1] = nmvm;

            _rightNextIndex++;
        }
        public MovieBriefViewModel(Movie movie, IEventAggregator eventAggregator)
        {
            if (string.IsNullOrEmpty(movie.Name))
            {
                IsDummy = true;
                _movie = movie;
                return;
            }

            _movie = movie;
            _movie.LoadPoster();

            _eventAggregator = eventAggregator;

            SequencialNo = _movie.SequencialNo;

            _originalWidth = _movie.Poster.Width;
            _originalHeight = _movie.Poster.Height;
        }
示例#3
0
 private void Remove(Movie movie)
 {
     if (_movies.Contains(movie))
     {
         _movies.Remove(movie);
     }
 }
示例#4
0
        private void Add(Movie movie)
        {
            if (_movies.Contains(movie))
                return;

            _movies.Add(movie);
        }
        public MovieDetailViewModel(Movie movie, IEventAggregator eventAggregator)
        {
            _movie = movie ?? new Movie();

            _eventAggregator = eventAggregator;
        }
 public void SetMovie(Movie movie)
 {
     if (!_movie.Equals(movie))
     {
         _movie = movie;
     }
 }