//public ArrayList GetTodos(string category) //{ // ArrayList t = new ArrayList(); // foreach (Todo todo in Todos) // { // if (todo.Categories != null) // { // foreach (TextCollection cat in todo.Categories) // { // foreach (Text text in cat.Values) // { // if (text.Value == category) // t.Add(todo); // } // } // } // } // return t; //} /// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { foreach (UniqueComponent uc in iCal.UniqueComponents) { this.AddChild(uc); } iCal.Dispose(); } }
//public ArrayList GetTodos(string category) //{ // ArrayList t = new ArrayList(); // foreach (Todo todo in Todos) // { // if (todo.Categories != null) // { // foreach (TextCollection cat in todo.Categories) // { // foreach (Text text in cat.Values) // { // if (text.Value == category) // t.Add(todo); // } // } // } // } // return t; //} /// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { foreach (iCalObject obj in iCal.Children) { this.AddChild(obj); } iCal.Dispose(); } }
/// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { // Merge all unique components foreach (UniqueComponent uc in iCal.UniqueComponents) { this.AddChild(uc); } // Dispose of the calendar, since we just siphoned the components from it. iCal.Dispose(); } }
/// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { // Merge all parameters foreach (Parameter p in iCal.Parameters) { if (!Parameters.ContainsKey(p.Key)) { AddParameter(p); } } // Merge all properties foreach (Property p in iCal.Properties) { if (!Properties.ContainsKey(p.Key)) { AddProperty(p); } } // Merge all unique components foreach (UniqueComponent uc in iCal.UniqueComponents) { if (!this.UniqueComponents.ContainsKey(uc.UID)) { this.AddChild(uc); } } // Add all time zones foreach (iCalTimeZone tz in iCal.TimeZones) { // Only add the time zone if it doesn't already exist if (this.GetTimeZone(tz.TZID) == null) { this.AddChild(tz); } } // Dispose of the calendar, since we just siphoned the components from it. iCal.Dispose(); } }
/// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { // Merge all unique components foreach (UniqueComponent uc in iCal.UniqueComponents) { this.AddChild(uc); } // Add all time zones foreach (DDay.iCal.Components.TimeZone tz in iCal.TimeZones) { // Only add the time zone if it doesn't already exist if (this.GetTimeZone(tz.TZID) == null) { this.AddChild(tz); } } // Dispose of the calendar, since we just siphoned the components from it. iCal.Dispose(); } }
//public ArrayList GetTodos(string category) //{ // ArrayList t = new ArrayList(); // foreach (Todo todo in Todos) // { // if (todo.Categories != null) // { // foreach (TextCollection cat in todo.Categories) // { // foreach (Text text in cat.Values) // { // if (text.Value == category) // t.Add(todo); // } // } // } // } // return t; //} /// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { foreach (UniqueComponent uc in iCal.UniqueComponents) this.AddChild(uc); iCal.Dispose(); } }
//public ArrayList GetTodos(string category) //{ // ArrayList t = new ArrayList(); // foreach (Todo todo in Todos) // { // if (todo.Categories != null) // { // foreach (TextCollection cat in todo.Categories) // { // foreach (Text text in cat.Values) // { // if (text.Value == category) // t.Add(todo); // } // } // } // } // return t; //} /// <summary> /// Merges the current <see cref="iCalendar"/> with another iCalendar. /// <note> /// Since each object is associated with one and only one iCalendar object, /// the <paramref name="iCal"/> that is passed is automatically Disposed /// in the process, because all of its objects are re-assocated with the new iCalendar. /// </note> /// </summary> /// <param name="iCal">The iCalendar to merge with the current <see cref="iCalendar"/></param> public void MergeWith(iCalendar iCal) { if (iCal != null) { foreach (iCalObject obj in iCal.Children) this.AddChild(obj); iCal.Dispose(); } }