예제 #1
0
 public static string MatchedChannelCallsign(this CommonEPG.TVProgramme tvp)
 {
     CommonEPG.TVService tvc = EPGManager.TVServiceWithIDOrNull(tvp.ServiceID);
     if (tvc == null)
     {
         return("Unknown");
     }
     return(tvc.Callsign);
 }
예제 #2
0
 public static int DurationMinutes(this CommonEPG.TVProgramme tvp)
 {
     try
     {
         long     lDuration = tvp.StopTime - tvp.StartTime;
         TimeSpan tDuration = new TimeSpan(lDuration);
         return(Convert.ToInt32(tDuration.TotalMinutes));
     }
     catch
     {
         if (Settings.Default.DebugAdvanced)
         {
             Functions.WriteLineToLogFile("Error [extension method error DurationMinutes] - could not get duration for show " + tvp.Title + " starts:" + tvp.StartTime.ToString() + " stops:" + tvp.StopTime.ToString());
         }
     }
     return(0);
 }
예제 #3
0
 public static bool IsTopRated(this CommonEPG.TVProgramme tvp)
 {
     return(tvp.StarRating > 7);
 }
예제 #4
0
 public static bool IsRecommended(this CommonEPG.TVProgramme tvp)
 {
     return(tvp.StarRating > 6);
 }
예제 #5
0
 public static bool HasEndedYet(this CommonEPG.TVProgramme tvp)
 {
     return(tvp.StopTimeDT().ToLocalTime() <= DateTime.Now);
 }
예제 #6
0
 public static string ToPrettyDate(this CommonEPG.TVProgramme tvp)
 {
     return(tvp.StartTimeDT().ToPrettyDate());
 }
예제 #7
0
 public static string ToPrettyStartStopLocalTimes(this CommonEPG.TVProgramme tvp)
 {
     return(tvp.StartTimeDT().ToLocalTime().ToShortTimeString() + " - " + tvp.StopTimeDT().ToLocalTime().ToShortTimeString());
 }
예제 #8
0
 public static DateTime OriginalAirDateDT(this CommonEPG.TVProgramme tvp)
 {
     return(new DateTime(tvp.OriginalAirDate, DateTimeKind.Utc));
 }
예제 #9
0
 public static DateTime StopTimeDT(this CommonEPG.TVProgramme tvp)
 {
     return(new DateTime(tvp.StopTime, DateTimeKind.Utc));
 }