public bool Contains(Object item) { foreach (Category c in this.categories.Values) { if (c.Contains(item.Name)) { return(true); } } return(false); }
public void Add(Object item) { if (item == null) { return; } if (item.Category == null) { throw new ArgumentException("Cannot add objects without a category"); } if (!this.categories.ContainsKey(item.Category.Name)) { this.Add(item.Category); } else { this.categories[item.Category.Name].AddObject(item); } }