Пример #1
0
        public override void AddChild(iCalObject child)
        {
            if (child is TimeZoneInfo)
                TimeZoneInfos.Add(child);

            base.AddChild(child);
        }
Пример #2
0
        public override void RemoveChild(iCalObject child)
        {
            if (child is TimeZoneInfo &&
                TimeZoneInfos.Contains(child))
                TimeZoneInfos.Remove(child);

            base.RemoveChild(child);
        }
Пример #3
0
        public override iCalObject Copy(iCalObject parent)
        {
            iCalDataType icdt = (iCalDataType)Activator.CreateInstance(GetType());

            icdt.CopyFrom(this);
            icdt.Parent = parent;
            return(icdt);
        }
Пример #4
0
 static public new ComponentBase Create(iCalObject parent, string name)
 {
     switch (name)
     {
         case "VEVENT": return new CustomEvent1(parent);
         default: return ComponentBase.Create(parent, name);
     }
 }
Пример #5
0
        static public new ComponentBase Create(iCalObject parent, string name)
        {
            switch (name)
            {
            case EVENT: return(new CustomEvent1(parent));

            default: return(ComponentBase.Create(parent, name));
            }
        }
Пример #6
0
 /// <summary>
 /// Adds an <see cref="iCalObject"/>-based component to the
 /// appropriate collection.  Currently, the TimeZone component
 /// supports the following components:
 ///     <list type="bullet">
 ///         <item>Standard</item>
 ///         <item>Daylight</item>
 ///     </list>
 /// </summary>
 /// <param name="child"></param>
 public override void AddChild(iCalObject child)
 {
     Type type = child.GetType();
     switch (type.Name)
     {
         case "Standard": TimeZoneInfos.Add(child); StandardTimes.Add(child); break;
         case "Daylight": TimeZoneInfos.Add(child); DaylightTimes.Add(child); break;
         default: break;
     }
 }
Пример #7
0
        public void calprop(
            iCalObject o
            )     //throws RecognitionException, TokenStreamException
        {
            try { // for error handling
                switch (LA(1))
                {
                case PRODID:
                {
                    prodid(o);
                    break;
                }

                case VERSION:
                {
                    version(o);
                    break;
                }

                case CALSCALE:
                {
                    calscale(o);
                    break;
                }

                case METHOD:
                {
                    method(o);
                    break;
                }

                case IANA_TOKEN:
                {
                    iana_prop(o);
                    break;
                }

                case X_NAME:
                {
                    x_prop(o);
                    break;
                }

                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                }
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_5_);
            }
        }
Пример #8
0
            /// <summary>
            /// Creates a copy of the <see cref="TimeZoneInfo"/> object.
            /// </summary>
            public override iCalObject Copy(iCalObject parent)
            {
                // Create a copy
                iCalObject obj = base.Copy(parent);

                // Copy the name, since the .ctor(iCalObject) constructor
                // doesn't handle it
                obj.Name = this.Name;
                
                return obj;
            }
Пример #9
0
 /// <summary>
 /// Invokes the object creation of the selected ComponentBase class.  By default,
 /// this is the ComponentBase class itself; however, this can be changed to allow
 /// for custom objects to be created in lieu of Event, Todo, Journal, etc. components.
 /// <note>
 /// This method is used internally by the parsing engine to create iCalendar objects.
 /// </note>
 /// </summary>
 /// <param name="parent">The parent of the object to create.</param>
 /// <param name="name">The name of the iCal object.</param>
 /// <returns>A newly created object</returns>
 internal ComponentBase Create(iCalObject parent, string name)
 {
     if (m_ComponentBaseCreate == null)
     {
         throw new ArgumentException("Create() cannot be called without a valid ComponentBase Create() method attached");
     }
     else
     {
         return((ComponentBase)m_ComponentBaseCreate.Invoke(null, new object[] { parent, name }));
     }
 }
Пример #10
0
 static public new ComponentBase Create(iCalObject parent, string name)
 {
     switch (name)
     {
         case "VEVENT":
             // For event objects, use our custom event class
             return new CustomEvent(parent);                    
         default:
             // Otherwise, use the default classes
             return ComponentBase.Create(parent, name);
     }
 }
Пример #11
0
        public void method(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            IToken   n = null;
            IToken   v = null;
            Property p;

            n = LT(1);
            match(METHOD);
            p = new Property(o);
            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == SEMICOLON))
                    {
                        match(SEMICOLON);
                        {
                            switch (LA(1))
                            {
                            case IANA_TOKEN:
                            {
                                param(p);
                                break;
                            }

                            case X_NAME:
                            {
                                xparam(p);
                                break;
                            }

                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                            }
                        }
                    }
                    else
                    {
                        goto _loop37_breakloop;
                    }
                }
                _loop37_breakloop :;
            }        // ( ... )*
            match(COLON);
            v = LT(1);
            match(IANA_TOKEN);
            p.Name = n.getText(); p.Value = v.getText(); p.AddToParent();
            match(CRLF);
        }
Пример #12
0
        public ComponentBase  x_comp(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            ComponentBase c = null;;

            IToken n = null;

            try {          // for error handling
                match(BEGIN);
                match(COLON);
                n = LT(1);
                match(X_NAME);
                c = o.iCalendar.Create(o, n.getText().ToLower());
                match(CRLF);
                {         // ( ... )+
                    int _cnt15 = 0;
                    for (;;)
                    {
                        if ((LA(1) == BEGIN || LA(1) == IANA_TOKEN || LA(1) == X_NAME))
                        {
                            calendarline(c);
                        }
                        else
                        {
                            if (_cnt15 >= 1)
                            {
                                goto _loop15_breakloop;
                            }
                            else
                            {
                                throw new NoViableAltException(LT(1), getFilename());;
                            }
                        }

                        _cnt15++;
                    }
                    _loop15_breakloop :;
                }            // ( ... )+
                match(END);
                match(COLON);
                match(X_NAME);
                match(CRLF);
                c.OnLoad(EventArgs.Empty);
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_4_);
            }
            return(c);
        }
Пример #13
0
 /// <summary>
 /// Adds an <see cref="iCalObject"/>-based component to the
 /// appropriate collection.  Currently, the iCalendar component
 /// supports the following components:
 ///     <list>
 ///         <item>Event</item>
 ///         <item>FreeBusy</item>
 ///         <item>Journal</item>
 ///         <item>TimeZone</item>
 ///         <item>Todo</item>
 ///     </list>
 /// </summary>
 /// <param name="child"></param>
 public override void AddChild(iCalObject child)
 {
     Type type = child.GetType();
     switch (type.Name)
     {
         case "Event": Events.Add(child); break;
         case "FreeBusy": FreeBusy.Add(child); break;
         case "Journal": Journals.Add(child); break;
         case "TimeZone": TimeZones.Add(child); break;
         case "Todo": Todos.Add(child); break;
         default: break;
     }                
 }
Пример #14
0
 static public ComponentBase Create(iCalObject parent, string name)
 {
     switch(name.ToUpper())
     {
         case "VALARM": return new Alarm(parent); break;
         case "VEVENT": return new Event(parent); break;
         case "VFREEBUSY": return new FreeBusy(parent); break;
         case "VJOURNAL": return new Journal(parent); break;
         case "VTIMEZONE": return new DDay.iCal.Components.TimeZone(parent); break;
         case "VTODO": return new Todo(parent); break;
         default: return new ComponentBase(parent, name); break;
     }
 }
Пример #15
0
        static public ComponentBase Create(iCalObject parent, string name)
        {
            switch (name.ToUpper())
            {
            case EVENT:
                // For event objects, use our custom event class
                return(new CustomEvent(parent));

            default:
                // Otherwise, use the default classes
                return(ComponentBase.Create(parent, name));
            }
        }
Пример #16
0
        public void contentline(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            ContentLine c = new ContentLine(o);
            string      n;
            string      v;


            n      = name();
            c.Name = n;
            {        // ( ... )*
                for (;;)
                {
                    if ((LA(1) == SEMICOLON))
                    {
                        match(SEMICOLON);
                        {
                            switch (LA(1))
                            {
                            case IANA_TOKEN:
                            {
                                param(c);
                                break;
                            }

                            case X_NAME:
                            {
                                xparam(c);
                                break;
                            }

                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                            }
                        }
                    }
                    else
                    {
                        goto _loop50_breakloop;
                    }
                }
                _loop50_breakloop :;
            }        // ( ... )*
            match(COLON);
            v       = value();
            c.Value = v; DDay.iCal.Serialization.iCalendar.Components.ContentLineSerializer.DeserializeToObject(c, o);
            match(CRLF);
        }
Пример #17
0
        public override iCalObject Copy(iCalObject parent)
        {
            iCalDataType icdt = (iCalDataType)Activator.CreateInstance(GetType());

            icdt.CopyFrom(this);

            // Add parameters
            foreach (Parameter p in Parameters)
            {
                p.Copy(icdt);
            }

            icdt.Parent = parent;
            return(icdt);
        }
Пример #18
0
        public override iCalObject Copy(iCalObject parent)
        {
            iCalDataType icdt = (iCalDataType)Activator.CreateInstance(GetType());

            icdt.CopyFrom(this);

            // Add parameters
            foreach (DictionaryEntry de in Parameters)
            {
                ((Parameter)(de.Value)).Copy(icdt);
            }

            icdt.Parent = parent;
            return(icdt);
        }
Пример #19
0
        public void calprop(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            switch (LA(1))
            {
            case PRODID:
            {
                prodid(o);
                break;
            }

            case VERSION:
            {
                version(o);
                break;
            }

            case CALSCALE:
            {
                calscale(o);
                break;
            }

            case METHOD:
            {
                method(o);
                break;
            }

            case IANA_TOKEN:
            {
                iana_prop(o);
                break;
            }

            case X_NAME:
            {
                x_prop(o);
                break;
            }

            default:
            {
                throw new NoViableAltException(LT(1), getFilename());
            }
            }
        }
Пример #20
0
 public static new ComponentBase Create(iCalObject parent, string name)
 {
     switch (name.ToUpper())
     {
         //case ALARM: return new Alarm(parent);
         case EVENT: return new McEvent(parent);
         //case FREEBUSY: return new FreeBusy(parent);
         //case JOURNAL: return new Journal(parent);
         //case TIMEZONE: return new iCalTimeZone(parent);
         //case TODO: return new Todo(parent);
         case DAYLIGHT:
         case STANDARD:
             return new TimeZoneInfo(name.ToUpper(), parent);
         default: return new McComponentBase(parent, name);
     }
 }
Пример #21
0
        public ComponentBase  x_comp(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            ComponentBase c = null;;

            IToken n = null;

            match(BEGIN);
            match(COLON);
            n = LT(1);
            match(X_NAME);
            c = o.iCalendar.Create(o, n.getText().ToLower());
            match(CRLF);
            {     // ( ... )+
                int _cnt17 = 0;
                for (;;)
                {
                    if ((tokenSet_3_.member(LA(1))))
                    {
                        calendarline(c);
                    }
                    else
                    {
                        if (_cnt17 >= 1)
                        {
                            goto _loop17_breakloop;
                        }
                        else
                        {
                            throw new NoViableAltException(LT(1), getFilename());;
                        }
                    }

                    _cnt17++;
                }
                _loop17_breakloop :;
            }        // ( ... )+
            match(END);
            match(COLON);
            match(X_NAME);
            match(CRLF);
            c.OnLoad(EventArgs.Empty);
            return(c);
        }
Пример #22
0
        static new public ComponentBase Create(iCalObject parent, string name)
        {
            switch (name.ToUpper())
            {
            //case ALARM: return new Alarm(parent);
            case EVENT: return(new McEvent(parent));

            //case FREEBUSY: return new FreeBusy(parent);
            //case JOURNAL: return new Journal(parent);
            //case TIMEZONE: return new iCalTimeZone(parent);
            //case TODO: return new Todo(parent);
            case DAYLIGHT:
            case STANDARD:
                return(new TimeZoneInfo(name.ToUpper(), parent));

            default: return(new McComponentBase(parent, name));
            }
        }
Пример #23
0
        public ComponentBase  component(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            ComponentBase c = null;;


            try {         // for error handling
                {         // ( ... )+
                    int _cnt9 = 0;
                    for (;;)
                    {
                        if ((LA(1) == BEGIN) && (LA(2) == COLON) && (LA(3) == IANA_TOKEN))
                        {
                            c = iana_comp(o);
                        }
                        else if ((LA(1) == BEGIN) && (LA(2) == COLON) && (LA(3) == X_NAME))
                        {
                            c = x_comp(o);
                        }
                        else
                        {
                            if (_cnt9 >= 1)
                            {
                                goto _loop9_breakloop;
                            }
                            else
                            {
                                throw new NoViableAltException(LT(1), getFilename());;
                            }
                        }

                        _cnt9++;
                    }
                    _loop9_breakloop :;
                }            // ( ... )+
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_4_);
            }
            return(c);
        }
Пример #24
0
        /// <summary>
        /// Adds an <see cref="iCalObject"/>-based component to the
        /// appropriate collection.  Currently, the iCalendar component
        /// supports the following components:
        ///     <list>
        ///         <item>Event</item>
        ///         <item>FreeBusy</item>
        ///         <item>Journal</item>
        ///         <item>TimeZone</item>
        ///         <item>Todo</item>
        ///     </list>
        /// </summary>
        /// <param name="child"></param>
        public override void AddChild(iCalObject child)
        {
            Type type = child.GetType();

            switch (type.Name)
            {
            case "Event": Events.Add(child); break;

            case "FreeBusy": FreeBusy.Add(child); break;

            case "Journal": Journals.Add(child); break;

            case "TimeZone": TimeZones.Add(child); break;

            case "Todo": Todos.Add(child); break;

            default: break;
            }
        }
        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 component!
            DDay.iCal.iCalendar iCal      = new DDay.iCal.iCalendar();
            iCalObject          component = parser.component(iCal);

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

            // Return the parsed component
            return(component);
        }
Пример #26
0
        public ComponentBase  component(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            ComponentBase c = null;;


            {     // ( ... )+
                int _cnt11 = 0;
                for (;;)
                {
                    if ((LA(1) == BEGIN) && (LA(2) == COLON) && (LA(3) == IANA_TOKEN))
                    {
                        c = iana_comp(o);
                    }
                    else if ((LA(1) == BEGIN) && (LA(2) == COLON) && (LA(3) == X_NAME))
                    {
                        c = x_comp(o);
                    }
                    else if ((LA(1) == CRLF) && (tokenSet_1_.member(LA(2))) && (tokenSet_2_.member(LA(3))))
                    {
                        match(CRLF);
                    }
                    else
                    {
                        if (_cnt11 >= 1)
                        {
                            goto _loop11_breakloop;
                        }
                        else
                        {
                            throw new NoViableAltException(LT(1), getFilename());;
                        }
                    }

                    _cnt11++;
                }
                _loop11_breakloop :;
            }        // ( ... )+
            return(c);
        }
Пример #27
0
        /// <summary>
        /// Creates a typed object that is a direct child of the iCalendar itself.  Generally,
        /// you would invoke this method to create an Event, Todo, Journal, TimeZone, FreeBusy,
        /// or other base component type.
        /// </summary>
        /// <example>
        /// To create an event, use the following:
        /// <code>
        /// iCalendar iCal = new iCalendar();
        ///
        /// Event evt = iCal.Create&lt;Event&gt;();
        /// </code>
        ///
        /// This creates the event, and adds it to the Events list of the iCalendar.
        /// </example>
        /// <typeparam name="T">The type of object to create</typeparam>
        /// <returns>An object of the type specified</returns>
        public T Create <T>() where T : iCalObject
        {
            if (m_ComponentBaseCreate == null)
            {
                throw new ArgumentException("Create() cannot be called without a valid ComponentBase Create() method attached");
            }

            ConstructorInfo ci = typeof(T).GetConstructor(new Type[] { typeof(iCalObject) });

            if (ci != null)
            {
                // Create a dummy object with a null parent
                iCalObject ico = ci.Invoke(new object[] { null }) as iCalObject;
                if (ico != null)
                {
                    iCalObject resultObject = m_ComponentBaseCreate.Invoke(null, new object[] { this, ico.Name }) as iCalObject;
                    resultObject.CreateInitialize();
                    return((T)(object)resultObject);
                }
            }
            return(default(T));
        }
Пример #28
0
        /// <summary>
        /// Adds an <see cref="iCalObject"/>-based component to the
        /// appropriate collection.  Currently, the iCalendar component
        /// supports the following components:
        ///     <list type="bullet">
        ///         <item><see cref="Event"/></item>
        ///         <item><see cref="FreeBusy"/></item>
        ///         <item><see cref="Journal"/></item>
        ///         <item><see cref="DDay.iCal.Components.TimeZone"/></item>
        ///         <item><see cref="Todo"/></item>
        ///     </list>
        /// </summary>
        /// <param name="child"></param>
        public override void AddChild(iCalObject child)
        {
            base.AddChild(child);
            child.Parent = this;

            Type type = child.GetType();

            switch (type.Name)
            {
            case "Event": Events.Add((Event)child); break;

            case "FreeBusy": FreeBusy.Add((FreeBusy)child); break;

            case "Journal": Journals.Add((Journal)child); break;

            case "TimeZone": TimeZones.Add((DDay.iCal.Components.TimeZone)child); break;

            case "Todo": Todos.Add((Todo)child); break;

            default: break;
            }
        }
Пример #29
0
        public void method(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            IToken   n = null;
            IToken   v = null;
            Property p;

            try {          // for error handling
                n = LT(1);
                match(METHOD);
                p = new Property(o);
                {            // ( ... )*
                    for (;;)
                    {
                        if ((LA(1) == SEMICOLON))
                        {
                            match(SEMICOLON);
                            xparam(p);
                        }
                        else
                        {
                            goto _loop29_breakloop;
                        }
                    }
                    _loop29_breakloop :;
                }            // ( ... )*
                match(COLON);
                v = LT(1);
                match(IANA_TOKEN);
                p.Name = n.getText(); p.Value = v.getText(); p.AddToParent();
                match(CRLF);
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_5_);
            }
        }
Пример #30
0
        public void calscale(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            IToken   n = null;
            IToken   v = null;
            Property p;

            try {          // for error handling
                n = LT(1);
                match(CALSCALE);
                {            // ( ... )*
                    for (;;)
                    {
                        if ((LA(1) == SEMICOLON))
                        {
                            match(SEMICOLON);
                            xparam(o);
                        }
                        else
                        {
                            goto _loop26_breakloop;
                        }
                    }
                    _loop26_breakloop :;
                }            // ( ... )*
                match(COLON);
                v = LT(1);
                match(IANA_TOKEN);
                p = new Property(o, n.getText(), v.getText());
                match(CRLF);
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_5_);
            }
        }
Пример #31
0
        public void contentline(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            ContentLine c = new ContentLine(o);
            string      n;
            string      v;


            try {          // for error handling
                n      = name();
                c.Name = n;
                {            // ( ... )*
                    for (;;)
                    {
                        if ((LA(1) == SEMICOLON))
                        {
                            match(SEMICOLON);
                            param(c);
                        }
                        else
                        {
                            goto _loop39_breakloop;
                        }
                    }
                    _loop39_breakloop :;
                }            // ( ... )*
                match(COLON);
                v       = value();
                c.Value = v; o.SetContentLineValue(c);
                match(CRLF);
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_4_);
            }
        }
Пример #32
0
        /// <summary>
        /// Creates a typed object that is a direct child of the iCalendar itself.  Generally,
        /// you would invoke this method to create an Event, Todo, Journal, TimeZone, FreeBusy,
        /// or other base component type.
        /// </summary>
        /// <example>
        /// To create an event, use the following:
        /// <code>
        /// iCalendar iCal = new iCalendar();
        ///
        /// Event evt = iCal.Create&lt;Event&gt;();
        /// </code>
        ///
        /// This creates the event, and adds it to the Events list of the iCalendar.
        /// </example>
        /// <typeparam name="T">The type of object to create</typeparam>
        /// <returns>An object of the type specified</returns>
        public T Create <T>()
        {
            if (m_ComponentBaseCreate == null)
            {
                throw new ArgumentException("Create() cannot be called without a valid ComponentBase Create() method attached");
            }

            // Create a dummy object with a null parent
            iCalObject obj = null;
            object     t   = Activator.CreateInstance(typeof(T), obj);

            if (t is iCalObject)
            {
                iCalObject ico = (iCalObject)t;

                // Create the type of object that we're looking for...
                return((T)m_ComponentBaseCreate.Invoke(null, new object[] { this, ico.Name }));
            }
            else
            {
                return(default(T));
            }
        }
Пример #33
0
            static public ComponentBase Create(iCalObject parent, string name)
            {
                switch (name)
                {
                case "VALARM": return(new DDay.iCal.Components.Alarm(parent)); break;

                case "VEVENT": return(new MyEvent(parent)); break;

                case "VFREEBUSY": return(new DDay.iCal.Components.FreeBusy(parent)); break;

                case "VJOURNAL": return(new DDay.iCal.Components.Journal(parent)); break;

                case "VTIMEZONE": return(new DDay.iCal.Components.TimeZone(parent)); break;

                case "VTODO": return(new DDay.iCal.Components.Todo(parent)); break;

                case "DAYLIGHT":
                case "STANDARD":
                    return(new DDay.iCal.Components.TimeZone.TimeZoneInfo(name.ToUpper(), parent)); break;

                default: return(new ComponentBase(parent, name)); break;
                }
            }
Пример #34
0
        public void version(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            IToken   n = null;
            Property p; string v;

            try {          // for error handling
                n = LT(1);
                match(VERSION);
                p = new Property(o);
                {            // ( ... )*
                    for (;;)
                    {
                        if ((LA(1) == SEMICOLON))
                        {
                            match(SEMICOLON);
                            xparam(p);
                        }
                        else
                        {
                            goto _loop23_breakloop;
                        }
                    }
                    _loop23_breakloop :;
                }            // ( ... )*
                match(COLON);
                v      = version_number();
                p.Name = n.getText(); p.Value = v; p.AddToParent();
                match(CRLF);
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_5_);
            }
        }
Пример #35
0
        public void xparam(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            IToken    n = null;
            Parameter p; string v;

            try {          // for error handling
                n = LT(1);
                match(X_NAME);
                p = new Parameter(o, n.getText());
                match(EQUAL);
                v = param_value();
                p.Values.Add(v);
                {            // ( ... )*
                    for (;;)
                    {
                        if ((LA(1) == COMMA))
                        {
                            match(COMMA);
                            v = param_value();
                            p.Values.Add(v);
                        }
                        else
                        {
                            goto _loop73_breakloop;
                        }
                    }
                    _loop73_breakloop :;
                }            // ( ... )*
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_6_);
            }
        }
Пример #36
0
        public void calprop(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            switch (LA(1))
            {
            case X_NAME:
            {
                x_prop(o);
                break;
            }

            case IANA_TOKEN:
            {
                iana_prop(o);
                break;
            }

            default:
            {
                throw new NoViableAltException(LT(1), getFilename());
            }
            }
        }
Пример #37
0
        public void x_prop(
            iCalObject o
            ) //throws RecognitionException, TokenStreamException
        {
            IToken   n = null;
            Property p; string v;

            try {          // for error handling
                n = LT(1);
                match(X_NAME);
                {            // ( ... )*
                    for (;;)
                    {
                        if ((LA(1) == SEMICOLON))
                        {
                            match(SEMICOLON);
                            xparam(o);
                        }
                        else
                        {
                            goto _loop35_breakloop;
                        }
                    }
                    _loop35_breakloop :;
                }            // ( ... )*
                match(COLON);
                v = text();
                p = new Property(o, n.getText(), v);
                match(CRLF);
            }
            catch (RecognitionException ex)
            {
                reportError(ex);
                recover(ex, tokenSet_5_);
            }
        }
Пример #38
0
	public void param(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		Parameter p; string n; string v;
		
		try {      // for error handling
			n=param_name();
			p = new Parameter(o, n);
			match(EQUAL);
			v=param_value();
			p.Values.Add(v);
			{    // ( ... )*
				for (;;)
				{
					if ((LA(1)==COMMA))
					{
						match(COMMA);
						v=param_value();
						p.Values.Add(v);
					}
					else
					{
						goto _loop45_breakloop;
					}
					
				}
_loop45_breakloop:				;
			}    // ( ... )*
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_6_);
		}
	}
Пример #39
0
	public void contentline(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		
		ContentLine c = new ContentLine(o);
		string n;
		string v;
		
		
		try {      // for error handling
			n=name();
			c.Name = n;
			{    // ( ... )*
				for (;;)
				{
					if ((LA(1)==SEMICOLON))
					{
						match(SEMICOLON);
						param(c);
					}
					else
					{
						goto _loop41_breakloop;
					}
					
				}
_loop41_breakloop:				;
			}    // ( ... )*
			match(COLON);
			v=value();
			c.Value = v; o.SetContentLineValue(c);
			match(CRLF);
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_4_);
		}
	}
Пример #40
0
	public void x_prop(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  n = null;
		Property p; string v;
		
		try {      // for error handling
			n = LT(1);
			match(X_NAME);
			p = new Property(o);
			{    // ( ... )*
				for (;;)
				{
					if ((LA(1)==SEMICOLON))
					{
						match(SEMICOLON);
						xparam(p);
					}
					else
					{
						goto _loop37_breakloop;
					}
					
				}
_loop37_breakloop:				;
			}    // ( ... )*
			match(COLON);
			v=text();
			p.Name = n.getText(); p.Value = v; p.AddToParent();
			match(CRLF);
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_5_);
		}
	}
Пример #41
0
	public void calprop(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		
		try {      // for error handling
			switch ( LA(1) )
			{
			case PRODID:
			{
				prodid(o);
				break;
			}
			case VERSION:
			{
				version(o);
				break;
			}
			case CALSCALE:
			{
				calscale(o);
				break;
			}
			case METHOD:
			{
				method(o);
				break;
			}
			case IANA_TOKEN:
			{
				iana_prop(o);
				break;
			}
			case X_NAME:
			{
				x_prop(o);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_5_);
		}
	}
Пример #42
0
 public RecurringComponent(iCalObject parent, string name) : base(parent, name)
 {
     DateTimes = new ArrayList();
     Alarms = new List<Alarm>();
 }
Пример #43
0
 /// <summary>
 /// Invokes the object creation of the selected ComponentBase class.  By default,
 /// this is the ComponentBase class itself; however, this can be changed to allow
 /// for custom objects to be created in lieu of Event, Todo, Journal, etc. components.
 /// </summary>
 /// <param name="parent">The parent of the object to create.</param>
 /// <param name="name">The name of the iCal object.</param>
 /// <returns></returns>
 public ComponentBase Create(iCalObject parent, string name)
 {
     if (m_ComponentBaseCreate == null)
         throw new ArgumentException("Create() cannot be called without a valid ComponentBase Create() method attached");
     else return (ComponentBase)m_ComponentBaseCreate.Invoke(null, new object[] { parent, name });
 }
Пример #44
0
 public UniqueComponent(iCalObject parent, string name) : base(parent, name) { }
Пример #45
0
 /// <summary>
 /// Constructs an Event object, with an <see cref="iCalObject"/>
 /// (usually an iCalendar object) as its parent.
 /// </summary>
 /// <param name="parent">An <see cref="iCalObject"/>, usually an iCalendar object.</param>
 public Event(iCalObject parent) : base(parent)
 {
     this.Name = "VEVENT";
     Periods = new ArrayList();
 }
Пример #46
0
 /// <summary>
 /// Constructs an Event object, with an <see cref="iCalObject"/>
 /// (usually an iCalendar object) as its parent.
 /// </summary>
 /// <param name="parent">An <see cref="iCalObject"/>, usually an iCalendar object.</param>
 public Event(iCalObject parent) : base(parent)
 {
     this.Name = "VEVENT";            
 }
Пример #47
0
 public MyComponentBase(iCalObject parent) : base(parent) { }
Пример #48
0
 public Todo(iCalObject parent)
     : base(parent)
 {
     this.Name = "VTODO";
 }
Пример #49
0
 public Standard(iCalObject parent)
     : base(parent)
 {
     this.Name = "STANDARD";
 }
Пример #50
0
 public McEvent(iCalObject parent)
     : base(parent)
 {
 }
Пример #51
0
 public UniqueComponent(iCalObject parent) : base(parent) {}
Пример #52
0
	public void component(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		
		try {      // for error handling
			{ // ( ... )+
				int _cnt9=0;
				for (;;)
				{
					if ((LA(1)==BEGIN) && (LA(2)==COLON) && (LA(3)==IANA_TOKEN))
					{
						iana_comp(o);
					}
					else if ((LA(1)==BEGIN) && (LA(2)==COLON) && (LA(3)==X_NAME)) {
						x_comp(o);
					}
					else
					{
						if (_cnt9 >= 1) { goto _loop9_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
					}
					
					_cnt9++;
				}
_loop9_breakloop:				;
			}    // ( ... )+
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_4_);
		}
	}
Пример #53
0
        /// <summary>
        /// Removes an <see cref="iCalObject"/>-based component from all
        /// of the collections that this object may be contained in within
        /// the iCalendar.
        /// </summary>
        /// <param name="child"></param>
        public override void RemoveChild(iCalObject child)
        {
            base.RemoveChild(child);

            if (child is UniqueComponent)
                UniqueComponents.Remove((UniqueComponent)child);

            Type type = child.GetType();
            if (type == typeof(Event) || type.IsSubclassOf(typeof(Event))) Events.Remove((Event)child);
            else if (type == typeof(FreeBusy) || type.IsSubclassOf(typeof(FreeBusy))) FreeBusy.Remove((FreeBusy)child);
            else if (type == typeof(Journal) || type.IsSubclassOf(typeof(Journal))) Journals.Remove((Journal)child);
            else if (type == typeof(DDay.iCal.Components.TimeZone) || type.IsSubclassOf(typeof(DDay.iCal.Components.TimeZone))) TimeZones.Remove((DDay.iCal.Components.TimeZone)child);
            else if (type == typeof(Todo) || type.IsSubclassOf(typeof(Todo))) Todos.Remove((Todo)child);
        }
Пример #54
0
 public TimeZoneInfo(string name, iCalObject parent)
     : base(parent)
 {
     this.Name = name;
 }
Пример #55
0
	public void x_comp(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  n = null;
		ComponentBase c;
		
		try {      // for error handling
			match(BEGIN);
			match(COLON);
			n = LT(1);
			match(X_NAME);
			c = o.iCalendar.Create(o, n.getText());
			match(CRLF);
			{ // ( ... )+
				int _cnt15=0;
				for (;;)
				{
					if ((LA(1)==BEGIN||LA(1)==IANA_TOKEN||LA(1)==X_NAME))
					{
						calendarline(c);
					}
					else
					{
						if (_cnt15 >= 1) { goto _loop15_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
					}
					
					_cnt15++;
				}
_loop15_breakloop:				;
			}    // ( ... )+
			match(END);
			match(COLON);
			match(X_NAME);
			match(CRLF);
			c.OnLoad(EventArgs.Empty);
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_4_);
		}
	}
Пример #56
0
 public Alarm(iCalObject parent)
     : base(parent)
 {            
     this.Name = "VALARM";
     Occurrences = new List<AlarmOccurrence>();
 }
Пример #57
0
 public ComponentBase(iCalObject parent, string name) : base(parent, name) { }
Пример #58
0
	public void calendarline(
		iCalObject o
	) //throws RecognitionException, TokenStreamException
{
		
		
		try {      // for error handling
			switch ( LA(1) )
			{
			case IANA_TOKEN:
			case X_NAME:
			{
				contentline(o);
				break;
			}
			case BEGIN:
			{
				component(o);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		catch (RecognitionException ex)
		{
			reportError(ex);
			recover(ex,tokenSet_4_);
		}
	}
Пример #59
0
 public CustomEvent1(iCalObject parent) : base(parent)
 {
 }
Пример #60
0
 public override void AddChild(iCalObject child)
 {
     if (child is Alarm)
         Alarms.Add((Alarm)child);
     base.AddChild(child);
 }