示例#1
0
        private static vEventCollection GetEvents(string data)
        {
            int lastPosition        = 0;
            vEventCollection events = new vEventCollection();

            if (data.ToUpper().IndexOf("BEGIN:VEVENT") == -1)
            {
                return(events);
            }
            if (data.ToUpper().IndexOf("END:VEVENT") == -1)
            {
                return(events);
            }

LookForFurtherEvents:

            var eventData = data.Substring(data.ToUpper().IndexOf("BEGIN:VEVENT", lastPosition), data.ToUpper().IndexOf("END:VEVENT", lastPosition) + 10 - data.ToUpper().IndexOf("BEGIN:VEVENT", lastPosition));

            lastPosition = data.ToUpper().IndexOf("END:VEVENT", lastPosition) + 10;
            events.Add(ParseEvent(eventData));

            if (data.ToUpper().IndexOf("BEGIN:VEVENT", lastPosition) != -1)
            {
                goto LookForFurtherEvents;
            }

            return(events);
        }
示例#2
0
        private static vEventCollection GetEvents(string data)
        {
            int lastPosition        = 0;
            vEventCollection events = new vEventCollection();

LookForFurtherEvents:
            string eventData = data.Substring(data.ToUpper().IndexOf("BEGIN:VEVENT", lastPosition), data.ToUpper().IndexOf("END:VEVENT", lastPosition) + 10 - data.ToUpper().IndexOf("BEGIN:VEVENT", lastPosition));

            lastPosition = data.ToUpper().IndexOf("END:VEVENT", lastPosition) + 10;
            events.Add(ActiveUp.Net.Groupware.vCalendar.Parser.ParseEvent(eventData));
            if (data.ToUpper().IndexOf("BEGIN:VEVENT", lastPosition) != -1)
            {
                goto LookForFurtherEvents;
            }
            return(events);
        }
 private static vEventCollection GetEvents(string data)
 {
     int lastPosition = 0;
     vEventCollection events = new vEventCollection();
     LookForFurtherEvents:
         string eventData = data.Substring(data.ToUpper().IndexOf("BEGIN:VEVENT",lastPosition),data.ToUpper().IndexOf("END:VEVENT",lastPosition)+10-data.ToUpper().IndexOf("BEGIN:VEVENT",lastPosition));
     lastPosition = data.ToUpper().IndexOf("END:VEVENT",lastPosition)+10;
     events.Add(ActiveUp.Net.Groupware.vCalendar.Parser.ParseEvent(eventData));
     if(data.ToUpper().IndexOf("BEGIN:VEVENT",lastPosition)!=-1) goto LookForFurtherEvents;
     return events;
 }