Пример #1
0
 public Video()
 {
     EpisodeExternalIds = new ExternalIds();
     ExternalIds        = new ExternalIds();
     User      = new User();
     Player    = new Player();
     Roles     = new ObservableCollectionEx <Role>();
     Genres    = new ObservableCollectionEx <Genre>();
     Producers = new ObservableCollectionEx <Producer>();
     Writers   = new ObservableCollectionEx <Writer>();
     Directors = new ObservableCollectionEx <Director>();
 }
Пример #2
0
        protected override bool OnUpdateFrom(Video newValue, List <string> updatedPropertyNames)
        {
            var isUpdated = UpdateValue(() => Title, newValue, updatedPropertyNames);

            isUpdated = UpdateValue(() => Summary, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => Guid, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => Art, newValue, updatedPropertyNames) | isUpdated;

            var thumbUpdated = UpdateValue(() => Thumb, newValue, updatedPropertyNames);

            thumbUpdated = UpdateValue(() => ParentThumb, newValue, updatedPropertyNames) | thumbUpdated;
            thumbUpdated = UpdateValue(() => GrandParentThumb, newValue, updatedPropertyNames) | thumbUpdated;

            if (thumbUpdated)
            {
                isUpdated        = true;
                ThumbImageSource = null;
            }

            isUpdated = UpdateValue(() => ViewOffset, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => Duration, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => Show, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => SeasonNumber, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => EpisodeNumber, newValue, updatedPropertyNames) | isUpdated;
            isUpdated = UpdateValue(() => Type, newValue, updatedPropertyNames) | isUpdated;

            if (Player == null)
            {
                Player = new Player();
            }
            if (User == null)
            {
                User = new User();
            }
            if (Roles == null)
            {
                Roles = new ObservableCollectionEx <Role>();
            }
            if (Genres == null)
            {
                Genres = new ObservableCollectionEx <Genre>();
            }
            if (Producers == null)
            {
                Producers = new ObservableCollectionEx <Producer>();
            }
            if (Writers == null)
            {
                Writers = new ObservableCollectionEx <Writer>();
            }
            if (Directors == null)
            {
                Directors = new ObservableCollectionEx <Director>();
            }

            isUpdated = Player.UpdateFrom(newValue.Player) | isUpdated;
            isUpdated = User.UpdateFrom(newValue.User) | isUpdated;
            isUpdated = Roles.UpdateToMatch(newValue.Roles, r => r.Key, (r1, r2) => r1.UpdateFrom(r2)) | isUpdated;
            isUpdated = Genres.UpdateToMatch(newValue.Genres, r => r.Key, (r1, r2) => r1.UpdateFrom(r2)) | isUpdated;
            isUpdated = Producers.UpdateToMatch(newValue.Producers, r => r.Key, (r1, r2) => r1.UpdateFrom(r2)) | isUpdated;
            isUpdated = Writers.UpdateToMatch(newValue.Writers, r => r.Key, (r1, r2) => r1.UpdateFrom(r2)) | isUpdated;
            isUpdated = Directors.UpdateToMatch(newValue.Directors, r => r.Key, (r1, r2) => r1.UpdateFrom(r2)) | isUpdated;

            isUpdated = ExternalIds.UpdateFrom(newValue.ExternalIds) | isUpdated;
            isUpdated = EpisodeExternalIds.UpdateFrom(newValue.EpisodeExternalIds) | isUpdated;

            return(isUpdated);
        }
Пример #3
0
 public Role()
 {
     ExternalIds = new ExternalIds();
     CastCredits = new List <ICastCrewCredit>();
     CrewCredits = new List <ICastCrewCredit>();
 }