private static TokenNode ReadTokenNode(TableEvent dbEvent) { var nodeParser = new ParserNodeToken(); TokenNode calendarNode; using (var stream = new MemoryStream()) { var writer = new StreamWriter(stream); writer.Write(dbEvent.CalendarData); writer.Flush(); stream.Seek(0, SeekOrigin.Begin); calendarNode = nodeParser.Parse(stream); } return calendarNode; }
public CalendarICal Parse(Stream value) { var nodeParser = new ParserNodeToken(); var rootNode = nodeParser.Parse(value).Childs[0]; var resultCal = new CalendarICal(); TokenNode eventNode = null; int i = 0; while ((eventNode = FindNextChild(rootNode, i, "VEVENT")) != null) { resultCal.Events.Add(ParseVEvent(eventNode)); i++; } return resultCal; }
public CalendarICal Parse(Stream value) { var nodeParser = new ParserNodeToken(); var rootNode = nodeParser.Parse(value).Childs[0]; var resultCal = new CalendarICal(); TokenNode eventNode = null; int i = 0; while ((eventNode = FindNextChild(rootNode, i, "VEVENT")) != null) { resultCal.Events.Add(ParseVEvent(eventNode)); i++; } return(resultCal); }