예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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);
        }