コード例 #1
0
        public static string GetYears(this MovieSeries movieSeries)
        {
            int startYear = movieSeries.GetStartYear();
            int endYear   = movieSeries.GetEndYear();

            return(startYear == endYear?startYear.ToString() : $"{startYear}-{endYear}");
        }
コード例 #2
0
        public static MovieSeriesEntry?GetLastEntry(this MovieSeries movieSeries)
        {
            var lastEntry = movieSeries.Entries.OrderByDescending(entry => entry.SequenceNumber).FirstOrDefault();

            return(lastEntry != null
                ? lastEntry.MovieSeries == null ? lastEntry : lastEntry.MovieSeries.GetLastEntry()
                : null);
        }
コード例 #3
0
        public static MovieSeriesEntry?GetFirstEntry(this MovieSeries movieSeries)
        {
            var firstEntry = movieSeries.Entries.OrderBy(entry => entry.SequenceNumber).FirstOrDefault();

            return(firstEntry != null
                ? firstEntry.MovieSeries == null ? firstEntry : firstEntry.MovieSeries.GetFirstEntry()
                : null);
        }
コード例 #4
0
        public static string GetActiveColor(this MovieSeries movieSeries)
        {
            var firstEntry = movieSeries.GetFirstEntry();

            return(firstEntry != null
                ? firstEntry.Movie?.GetActiveColor() ?? firstEntry.Series !.GetActiveColor()
                : String.Empty);
        }
コード例 #5
0
        public static int GetEndYear(this MovieSeries movieSeries)
        {
            var lastEntry = movieSeries.GetLastEntry();

            return(lastEntry != null
                ? lastEntry.Movie?.Year ?? lastEntry.Series?.EndYear ?? lastEntry.MovieSeries !.GetEndYear()
                : 0);
        }
コード例 #6
0
        public static int GetStartYear(this MovieSeries movieSeries)
        {
            var firstEntry = movieSeries.GetFirstEntry();

            return(firstEntry != null
                ? firstEntry.Movie?.Year ?? firstEntry.Series?.StartYear ?? firstEntry.MovieSeries !.GetStartYear()
                : 0);
        }
コード例 #7
0
 public static bool IsStrictDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor)
 => movieSeries != potentialAncestor && movieSeries.IsDescendantOf(potentialAncestor);
コード例 #8
0
 public static bool IsDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor)
 => movieSeries != null &&
 (movieSeries.Id == potentialAncestor.Id ||
  (movieSeries.Entry?.ParentSeries.IsDescendantOf(potentialAncestor) ?? false));
コード例 #9
0
 public static MovieSeries GetRootSeries(this MovieSeries movieSeries)
 => movieSeries.Entry == null ? movieSeries : movieSeries.Entry.ParentSeries.GetRootSeries();
コード例 #10
0
 public static Title?GetListTitle(this MovieSeries movieSeries)
 => movieSeries.ShowTitles ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
コード例 #11
0
 public static Title?GetTitle(this MovieSeries movieSeries)
 => movieSeries.Titles.Count > 0 ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
コード例 #12
0
 public static (MovieSeries, MovieSeries) GetDistinctAncestors(this MovieSeries series1, MovieSeries series2)
 => series1.GetAllAncestors()