public void RemoveObject(OrganizerObject obj) { if (obj is Contact) { //TODO: filter the contacts first. this.contacts.Remove(obj as Contact); } else if (obj is Event) { this.events.Remove(obj as Event); } if (obj is Email) { this.emails.Remove(obj as Email); } }
public void AddObject(OrganizerObject obj) { if (obj is Contact) { this.contacts.Add(obj as Contact); counter.IncreaseContacts(); } else if (obj is Event) { this.events.Add(obj as Event); counter.IncreaseEvents(); } else if (obj is Email) { this.emails.Add(obj as Email); counter.IncreaseEmails(); } }