Ejemplo n.º 1
0
 /// <summary>
 /// Removes a child element from the composite.
 /// </summary>
 /// <param name="component">The child component.</param>
 public void Remove(IVisitableComponent component)
 {
     _children.Remove(component);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Unimplemented method. Can't remove a children from a leaf component.
 /// </summary>
 /// <param name="component">The child component.</param>
 public void Remove(IVisitableComponent component)
 {
     throw new InvalidOperationException("Impossible to remove children from a leaf.");
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a child element to the composite.
 /// </summary>
 /// <param name="component">The child component.</param>
 public void Add(IVisitableComponent component)
 {
     _children.Add(component);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Unimplemented method. Can't add a children to a leaf component.
 /// </summary>
 /// <param name="component">The child component.</param>
 public void Add(IVisitableComponent component)
 {
     throw new InvalidOperationException("Impossible to add children to a leaf.");
 }