/// <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; if (child is UniqueComponent) { UniqueComponents.Add((UniqueComponent)child); } Type type = child.GetType(); if (type == typeof(Event) || type.IsSubclassOf(typeof(Event))) { Events.Add((Event)child); } else if (type == typeof(FreeBusy) || type.IsSubclassOf(typeof(FreeBusy))) { FreeBusy.Add((FreeBusy)child); } else if (type == typeof(Journal) || type.IsSubclassOf(typeof(Journal))) { Journals.Add((Journal)child); } else if (type == typeof(DDay.iCal.Components.TimeZone) || type.IsSubclassOf(typeof(DDay.iCal.Components.TimeZone))) { TimeZones.Add((DDay.iCal.Components.TimeZone)child); } else if (type == typeof(Todo) || type.IsSubclassOf(typeof(Todo))) { Todos.Add((Todo)child); } }
/// <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; } }
/// <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; } }