// Conversion / Lookup public static string ScheduleEventSafeTitle(ScheduleEvent se) { try { ScheduleRequest sr = se.GetScheduleRequest(); if (sr != null) { return((string)sr.GetExtendedProperty("Title")); } } catch { } return((string)se.GetExtendedProperty("Title")); }
public static bool CachedRedDotRecordingMatchesAndIsRecording(string eventKey, ref bool isSeriesRecording) { isSeriesRecording = false; if (!EventScheduleExists) { return(false); } if (!_cachedScheduledEventNames.ContainsKey(eventKey)) { return(false); } string seID = _cachedScheduledEventNames[eventKey]; // is this event recording? ScheduleEvent se = es.GetScheduleEventWithId(seID); if (se != null) { //eventID = se.Id; if ((se.State == ScheduleEventStates.WillOccur) | (se.State == ScheduleEventStates.IsOccurring) | (se.State == ScheduleEventStates.HasOccurred)) { ScheduleRequest sr = null; try { sr = se.GetScheduleRequest(); // Get property from the schedule request if possible, to get series info and also avoid strain on maxRequests errors! isSeriesRecording = ((string)sr.GetExtendedProperty("RequestType") == "Series"); } catch { } // no schedule request attached, so no series recording: dont flag this return(true); } } return(false); }
public static bool IsScheduleEventPartOfSeries(ScheduleEvent se, out string _requestid) { ScheduleRequest sr = null; _requestid = ""; try { sr = se.GetScheduleRequest(); } catch { return(false); } if (sr == null) { return(false); } if ((string)sr.GetExtendedProperty("RequestType") == "Series") { _requestid = sr.Id; return(true); } return(false); }