Пример #1
0
        /// <summary>
        /// Loads an <see cref="iCalendar"/> from an open stream.
        /// </summary>
        /// <param name="s">The stream from which to load the <see cref="iCalendar"/> object</param>
        /// <returns>An <see cref="iCalendar"/> object</returns>
        static public iCalendar LoadFromStream(Stream s)
        {
            iCalLexer  lexer  = new iCalLexer(s);
            iCalParser parser = new iCalParser(lexer);

            return(parser.icalobject());
        }
Пример #2
0
        static public iCalendar LoadFromStream(Type iCalendarType, TextReader tr)
        {
            // Create a lexer for our text stream
            iCalLexer  lexer  = new iCalLexer(tr);
            iCalParser parser = new iCalParser(lexer);

            // Determine the calendar type we'll be using when constructing
            // iCalendar objects...
            parser.iCalendarType = iCalendarType;

            // Parse the iCalendar!
            iCalendar iCal = parser.icalobject();

            // Close our text stream
            tr.Close();

            // Return the parsed iCalendar
            return(iCal);
        }
Пример #3
0
 static public iCalendar LoadFromStream(Type iCalendarType, Stream s)
 {
     iCalLexer lexer = new iCalLexer(s);
     iCalParser parser = new iCalParser(lexer);
     parser.iCalendarType = iCalendarType;
     return parser.icalobject();
 }
Пример #4
0
        static public iCalendar LoadFromStream(Type iCalendarType, Stream s)
        {            
            TextReader tr = new StreamReader(s, Encoding.UTF8);

            // Create a lexer for our memory stream
            iCalLexer lexer = new iCalLexer(tr);
            iCalParser parser = new iCalParser(lexer);

            // Determine the calendar type we'll be using when constructing
            // iCalendar objects...
            parser.iCalendarType = iCalendarType;

            // Parse the iCalendar!
            iCalendar iCal = parser.icalobject();

            // Close our memory stream
            tr.Close();

            // Return the parsed iCalendar
            return iCal;
        }