better serialize calendar events
This commit is contained in:
parent
8b1f042ec9
commit
6f450e25bc
@ -54,6 +54,13 @@ namespace director
|
||||
if (asEvent == null) { return null; }
|
||||
return ser.SerializeToString(asEvent);
|
||||
}
|
||||
internal static CalendarEvent Event_FromString(string asString)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(asString)) { return null; }
|
||||
|
||||
var toReturn = Calendar.Load<CalendarEvent>(asString)?.FirstOrDefault();
|
||||
return toReturn as CalendarEvent;
|
||||
}
|
||||
public static IEnumerable<CalendarOccurrence> getOccurrences(string calLabel)
|
||||
{
|
||||
var usefulList = new List<CalendarOccurrence>();
|
||||
@ -71,7 +78,7 @@ namespace director
|
||||
}
|
||||
public class CalendarOccurrence
|
||||
{
|
||||
internal string CalendarSourceName { get; set; }
|
||||
public string CalendarSourceName { get; set; }
|
||||
internal CalendarEvent _event { get; set; }
|
||||
public string Event
|
||||
{
|
||||
@ -79,6 +86,10 @@ namespace director
|
||||
{
|
||||
return iCalHoopJumping.Event_ToString(_event);
|
||||
}
|
||||
set
|
||||
{
|
||||
_event = iCalHoopJumping.Event_FromString(value);
|
||||
}
|
||||
}
|
||||
public DateTime OccurrenceStart { get; set; }
|
||||
public DateTime OccurrenceEnd { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user