/// <summary> /// 接收一个访问者,使所有的Element都执行这个动作 /// </summary> /// <param name="visitor"></param> public void Accept(Visitor visitor) { foreach (var item in _list) { item.Accept(visitor); } }
public override void Accept(Visitor visitor) { visitor.CallByElementB(this); Console.WriteLine(); }
public abstract void Accept(Visitor visitor);