Inheritance: JryObject, IJryCoverParent
コード例 #1
0
ファイル: CoverBuilder.cs プロジェクト: Cologler/JRYVideo
 public static CoverBuilder CreateBackground(JryVideoInfo video)
 {
     return new CoverBuilder(video.BackgroundImageAsCoverParent())
     {
         CoverType = CoverType.Background
     };
 }
コード例 #2
0
 public VideoEditorWindow(JrySeries series, JryVideoInfo video)
     : this()
 {
     this.EditVideoUserControl.ViewModel.Updated += this.VideoInfo_Updated;
     this.EditVideoUserControl.ViewModel.Parent = series;
     this.EditVideoUserControl.ViewModel.ModifyMode(video);
 }
コード例 #3
0
 void VideoInfo_Updated(object sender, JryVideoInfo e)
 {
     if (this.GetUIDispatcher().CheckAccessOrBeginInvoke(this.VideoInfo_Updated, sender, e))
     {
         this.DialogResult = true;
     }
 }
コード例 #4
0
ファイル: CoverBuilder.cs プロジェクト: Cologler/JRYVideo
 public static CoverBuilder CreateVideo(JryVideoInfo video)
 {
     return new CoverBuilder(video)
     {
         CoverType = CoverType.Video,
     };
 }
コード例 #5
0
 void ViewModel_Created(object sender, JryVideoInfo e)
 {
     if (this.GetUIDispatcher().CheckAccessOrBeginInvoke(this.ViewModel_Created, sender, e))
     {
         this.TryFindParent<Window>().DialogResult = true;
     }
 }
コード例 #6
0
ファイル: JryVideo.cs プロジェクト: gitter-badger/JRYVideo
 public static JryVideo Build(JryVideoInfo info)
 {
     return new JryVideo()
     {
         Id = info.Id
     };
 }
コード例 #7
0
        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)));
        }
コード例 #8
0
ファイル: DataCenter.cs プロジェクト: Cologler/JRYVideo
 /// <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;
 }
コード例 #9
0
 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;
 }
コード例 #10
0
 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;
     }
 }
コード例 #11
0
ファイル: DataCenter.cs プロジェクト: Cologler/JRYVideo
 /// <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;
 }
コード例 #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;
        }
コード例 #13
0
        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;
        }
コード例 #14
0
 public VideoInfoRef(string seriesId, JryVideoInfo obj)
     : base(obj)
 {
     this.SeriesId = seriesId;
 }
コード例 #15
0
 internal BackgroundCoverParent(JryVideoInfo parent)
 {
     this.parent = parent;
 }
コード例 #16
0
ファイル: JryVideoInfo.cs プロジェクト: Cologler/JRYVideo
 internal BackgroundCoverParent(JryVideoInfo parent)
 {
     this.parent = parent;
 }
コード例 #17
0
ファイル: JryVideoInfo.cs プロジェクト: Cologler/JRYVideo
        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;
        }