Example #1
0
 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);
 }
Example #2
0
        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);
        }
Example #3
0
 public void Remove(AbstractContainer container)
 {
     RemoveByName(container.Name);
 }