Esempio n. 1
0
        public override object Deserialize(TextReader tr)
        {
            if (tr != null)
            {
                // Normalize the text before parsing it
                tr = TextUtil.Normalize(tr, SerializationContext);

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

                // Get our serialization context
                ISerializationContext ctx = SerializationContext;

                // Parse the component!
                ICalendarProperty p = parser.property(ctx, null);

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

                // Return the parsed property
                return(p);
            }
            return(null);
        }
        public override object Deserialize(TextReader tr)
        {
            if (tr != null)
            {
                // Normalize the text before parsing it
                tr = TextUtil.Normalize(tr, SerializationContext);

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

                // Get our serialization context
                ISerializationContext ctx = SerializationContext;

                // Get a serializer factory from our serialization services
                ISerializerFactory sf = GetService <ISerializerFactory>();

                // Get a calendar component factory from our serialization services
                ICalendarComponentFactory cf = GetService <ICalendarComponentFactory>();

                // Parse the component!
                ICalendarComponent component = parser.component(ctx, sf, cf, null);

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

                // Return the parsed component
                return(component);
            }
            return(null);
        }
        public override object Deserialize(TextReader tr)
        {
            // Create a lexer for our text stream
            iCalLexer  lexer  = new iCalLexer(tr);
            iCalParser parser = new iCalParser(lexer);

            // Get our serialization context
            ISerializationContext ctx = SerializationContext;

            // Parse the component!
            ICalendarParameter p = parser.parameter(ctx, null);

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

            // Return the parsed parameter
            return(p);
        }
        public override object Deserialize(TextReader tr)
        {
            // Create a lexer for our text stream
            iCalLexer lexer = new iCalLexer(tr);
            iCalParser parser = new iCalParser(lexer);

            // Get our serialization context
            ISerializationContext ctx = SerializationContext;

            // Parse the component!
            ICalendarParameter p = parser.parameter(ctx, null);

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

            // Return the parsed parameter
            return p;
        } 
        public override iCalObject Deserialize(TextReader tr, Type iCalendarType)
        {
            // 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!
            DDay.iCal.iCalendar iCal = parser.icalobject();

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

            // Return the parsed iCalendar
            return iCal;
        }
        public override object Deserialize(TextReader tr)
        {
            if (tr != null)
            {
                // Normalize the text before parsing it
                tr = TextUtil.Normalize(tr, SerializationContext);

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

                // Parse the iCalendar(s)!
                IICalendarCollection iCalendars = parser.icalendar(SerializationContext);

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

                // Return the parsed iCalendar(s)
                return(iCalendars);
            }
            return(null);
        }
        public override iCalObject Deserialize(TextReader tr, Type iCalendarType)
        {
            // Normalize line endings, so "\r" is treated the same as "\r\n"
            // NOTE: fixed bug #1773194 - Some applications emit mixed line endings
            TextReader textReader = NormalizeLineEndings(tr);

            // Create a lexer for our text stream
            iCalLexer lexer = new iCalLexer(textReader);
            iCalParser parser = new iCalParser(lexer);

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

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

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

            // Return the parsed iCalendar
            return iCal;
        }
Esempio n. 8
0
        public override object Deserialize(TextReader tr)
        {
            if (tr != null)
            {
                // Normalize the text before parsing it
                tr = TextUtil.Normalize(tr, SerializationContext);

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

                // Get our serialization context
                ISerializationContext ctx = SerializationContext;

                // Parse the component!
                ICalendarProperty p = parser.property(ctx, null);

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

                // Return the parsed property
                return p;
            }
            return null;
        }