-
Notifications
You must be signed in to change notification settings - Fork 248
Deserialize an ics file
axunonb edited this page Jun 14, 2025
·
6 revisions
ics files are like containers: they can contain one or more VCALENDARs, and each VCALENDAR can contain many elements.
var calendar = Calendar.Load(icalText);var manyCalendars = CalendarCollection.Load(severalCalendarsText);With v4, it's now possible to deserialize smaller entities like CalendarEvents:
const string veventText = @"BEGIN:VEVENT
CREATED:20060717T210517Z
LAST-MODIFIED:20060717T210718Z
DTSTAMP:20060717T210718Z
UID:uuid1153170430406
SUMMARY:Test event
DTSTART:20060718T100000
DTEND:20060718T110000
LOCATION:Daywest
END:VEVENT";
var calendarEvent = Calendar.Load<CalendarEvent>(veventTest);