/// <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); } }
public void Delete() { if (SelectedTimeZone == null) { return; } TimeZoneRepository.Instance.RemoveItem(SelectedTimeZone); TimeZones.Remove(SelectedTimeZone); Title = ""; SelectedHourIndex = 11; SelectedMinutesIndex = 0; }