public void Add(AbstractContainer containerToAdd) { if (Contains(containerToAdd.Name)) { throw new ArgumentException($"Folder {Name} already contains folder with name {containerToAdd.Name}"); } containerToAdd.Parent = this; _containers.Add(containerToAdd); }
public void RemoveByName(string name) { AbstractContainer comp = GetChildOrDefault(name); if (comp == null) { throw new ArgumentException($"There is no container with name: {name}"); } _containers.Remove(comp); }
public void Remove(AbstractContainer container) { RemoveByName(container.Name); }