/// <summary> /// 添加子节点 /// </summary> /// <param name="component"></param> public abstract void Add(Component component);
/// <summary> /// 删除指定的节点 /// </summary> /// <param name="component"></param> public abstract void RemoveAt(Component component);
public override void Add(Component component) { throw new NotSupportedException("不支持Add操作!"); }
public override void RemoveAt(Component component) { throw new NotSupportedException("不支持RemoveAt操作!"); }
public override void Add(Component component) { _componentList.Add(component); }
public override void RemoveAt(Component component) { _componentList.Remove(component); }
/// <inheritdoc /> public override void Add(Component c) { Console.WriteLine("leaf can't not add"); }
/// <inheritdoc /> public override void Remove(Component c) { Console.WriteLine("leaf can't not remove"); }
public abstract void Remove(Component c);
public abstract void Add(Component c);
/// <inheritdoc /> public override void Remove(Component c) { components.Remove(c); }
public Composite Add2Self(Component c) { components.Add(c); return(this); }
/// <inheritdoc /> public override void Add(Component c) { components.Add(c); }