Inheritance: JryObject, IJryCoverParent
Exemple #1
0
 public static CoverBuilder CreateBackground(JryVideoInfo video)
 {
     return new CoverBuilder(video.BackgroundImageAsCoverParent())
     {
         CoverType = CoverType.Background
     };
 }
 public VideoEditorWindow(JrySeries series, JryVideoInfo video)
     : this()
 {
     this.EditVideoUserControl.ViewModel.Updated += this.VideoInfo_Updated;
     this.EditVideoUserControl.ViewModel.Parent = series;
     this.EditVideoUserControl.ViewModel.ModifyMode(video);
 }
 void VideoInfo_Updated(object sender, JryVideoInfo e)
 {
     if (this.GetUIDispatcher().CheckAccessOrBeginInvoke(this.VideoInfo_Updated, sender, e))
     {
         this.DialogResult = true;
     }
 }
Exemple #4
0
 public static CoverBuilder CreateVideo(JryVideoInfo video)
 {
     return new CoverBuilder(video)
     {
         CoverType = CoverType.Video,
     };
 }
 void ViewModel_Created(object sender, JryVideoInfo e)
 {
     if (this.GetUIDispatcher().CheckAccessOrBeginInvoke(this.ViewModel_Created, sender, e))
     {
         this.TryFindParent<Window>().DialogResult = true;
     }
 }
Exemple #6
0
 public static JryVideo Build(JryVideoInfo info)
 {
     return new JryVideo()
     {
         Id = info.Id
     };
 }
        public VideoRoleCollectionViewModel(Series series, JryVideoInfo video)
        {
            this.series = series;
            this.video = video;

            this.Roles.View.CustomSort = this;
            this.Roles.View.GroupDescriptions?.Add(new PropertyGroupDescription(nameof(VideoRoleViewModel.GroupTitle)));
        }
Exemple #8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="to">after combine will live</param>
 /// <param name="from">after combine will dead</param>
 /// <returns></returns>
 public async Task<CombineResult> CanCombineAsync(VideoInfoManager manager, JryVideoInfo to, JryVideoInfo from)
 {
     var result = await manager.CanCombineAsync(to.Id, from.Id);
     if (!result.CanCombine) return result;
     result = await this.VideoRoleManager.CanCombineAsync(to.Id, from.Id);
     if (!result.CanCombine) return result;
     return CombineResult.True;
 }
 public async Task<bool> AutoCompleteRoleAsync(VideoRoleManager manager, JryVideoInfo video)
 {
     var imdbId = video.GetValidImdbId();
     if (imdbId != null)
     {
         return await manager.AutoCreateVideoRoleAsync(video.Id, new RemoteId(RemoteIdType.Imdb, imdbId));
     }
     return false;
 }
 void ViewModel_Created(object sender, JryVideoInfo e)
 {
     if (this.GetUIDispatcher().CheckAccessOrBeginInvoke(this.ViewModel_Created, sender, e))
     {
         var win = this.TryFindParent<AddWindow>();
         win.IsCommited = true;
         win.DialogResultObject = e;
         win.DialogResult = true;
     }
 }
Exemple #11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="to">after combine will live</param>
 /// <param name="from">after combine will dead</param>
 /// <returns></returns>
 public async Task<CombineResult> CombineAsync(VideoInfoManager manager, JryVideoInfo to, JryVideoInfo from)
 {
     var result = await this.CanCombineAsync(manager, to, from);
     if (result.CanCombine)
     {
         await this.VideoRoleManager.CombineAsync(to.Id, from.Id);
         await manager.CombineAsync(to, from);
     }
     return result;
 }
Exemple #12
0
        public void CombineFrom(JryVideoInfo other)
        {
            if (this.Type != other.Type)
            {
                throw new InvalidOperationException();
            }
            if (this.Year != other.Year)
            {
                throw new InvalidOperationException();
            }
            if (this.Index != other.Index)
            {
                throw new InvalidOperationException();
            }

            this.Names = this.Names.Concat(other.Names).Distinct().ToList();

            if (!CanCombineField(this.LastVideoId, other.LastVideoId))
            {
                throw new InvalidOperationException();
            }
            this.LastVideoId = this.LastVideoId ?? other.LastVideoId;

            if (!CanCombineField(this.NextVideoId, other.NextVideoId))
            {
                throw new InvalidOperationException();
            }
            this.NextVideoId = this.NextVideoId ?? other.NextVideoId;

            if (!CanCombineField(this.DoubanId, other.DoubanId))
            {
                throw new InvalidOperationException();
            }
            this.DoubanId = this.DoubanId ?? other.DoubanId;

            if (!CanCombineField(this.ImdbId, other.ImdbId))
            {
                throw new InvalidOperationException();
            }
            this.ImdbId = this.ImdbId ?? other.ImdbId;

            this.IsTracking = this.IsTracking || other.IsTracking;
            this.IsAllAired = this.IsAllAired || other.IsAllAired;

            if (this.EpisodesCount != other.EpisodesCount)
            {
                throw new InvalidOperationException();
            }

            this.Tags          = CombineStrings(this.Tags, other.Tags);
            this.EpisodeOffset = this.EpisodeOffset ?? other.EpisodeOffset;
            this.DayOfWeek     = this.DayOfWeek ?? other.DayOfWeek;
            this.StartDate     = this.StartDate ?? other.StartDate;
        }
        public static SelectResult<JryVideoInfo> Select(Window parent, SeriesViewModel source, JryVideoInfo without = null, string defaultId = null)
        {
            var dialog = new VideoSelectorWindow() { Owner = parent };
            if (without != null)
            {
                dialog.SelectVideoControl.ViewModel.Withouts.Add(without.Id);
            }
            dialog.SelectVideoControl.Initialize(source, defaultId);

            return dialog.ShowDialog() == true
                ? SelectResult<JryVideoInfo>.Selected(dialog.SelectVideoControl.ViewModel.Items.Selected?.Source)
                : SelectResult<JryVideoInfo>.NonAccept;
        }
 public VideoInfoRef(string seriesId, JryVideoInfo obj)
     : base(obj)
 {
     this.SeriesId = seriesId;
 }
Exemple #15
0
 internal BackgroundCoverParent(JryVideoInfo parent)
 {
     this.parent = parent;
 }
Exemple #16
0
 internal BackgroundCoverParent(JryVideoInfo parent)
 {
     this.parent = parent;
 }
Exemple #17
0
        public void CombineFrom(JryVideoInfo other)
        {
            if (this.Type != other.Type) throw new InvalidOperationException();
            if (this.Year != other.Year) throw new InvalidOperationException();
            if (this.Index != other.Index) throw new InvalidOperationException();

            this.Names = this.Names.Concat(other.Names).Distinct().ToList();

            if (!CanCombineField(this.LastVideoId, other.LastVideoId)) throw new InvalidOperationException();
            this.LastVideoId = this.LastVideoId ?? other.LastVideoId;

            if (!CanCombineField(this.NextVideoId, other.NextVideoId)) throw new InvalidOperationException();
            this.NextVideoId = this.NextVideoId ?? other.NextVideoId;

            if (!CanCombineField(this.DoubanId, other.DoubanId)) throw new InvalidOperationException();
            this.DoubanId = this.DoubanId ?? other.DoubanId;

            if (!CanCombineField(this.ImdbId, other.ImdbId)) throw new InvalidOperationException();
            this.ImdbId = this.ImdbId ?? other.ImdbId;

            this.IsTracking = this.IsTracking || other.IsTracking;
            this.IsAllAired = this.IsAllAired || other.IsAllAired;

            if (this.EpisodesCount != other.EpisodesCount) throw new InvalidOperationException();

            this.Tags = CombineStrings(this.Tags, other.Tags);
            this.EpisodeOffset = this.EpisodeOffset ?? other.EpisodeOffset;
            this.DayOfWeek = this.DayOfWeek ?? other.DayOfWeek;
            this.StartDate = this.StartDate ?? other.StartDate;
        }