public static CalendarParsedResult parse(Result result) { string text = result.Text; if (text == null) { return(null); } int num = text.IndexOf("BEGIN:VEVENT"); if (num < 0) { return(null); } int num2 = text.IndexOf("END:VEVENT"); if (num2 < 0) { return(null); } string summary = VCardResultParser.matchSingleVCardPrefixedField("SUMMARY", text, true); string start = VCardResultParser.matchSingleVCardPrefixedField("DTSTART", text, true); string end = VCardResultParser.matchSingleVCardPrefixedField("DTEND", text, true); CalendarParsedResult result2; try { result2 = new CalendarParsedResult(summary, start, end, null, null, null); } catch (ArgumentException) { result2 = null; } return(result2); }
public CalendarParsedResult(string summary, string start, string end, string location, string attendee, string title) : base(ParsedResultType.CALENDAR) { if (start == null) { throw new ArgumentException(); } CalendarParsedResult.validateDate(start); CalendarParsedResult.validateDate(end); this.summary = summary; this.start = start; this.end = end; this.location = location; this.attendee = attendee; this.title = title; }