public void Accept(ICarElementVisitor visitor) { foreach (var element in this._elements) { element.Accept(visitor); } visitor.Visit(this); }
public void Accept(ICarElementVisitor visitor) { foreach (ICarElement elem in _elements) { elem.Accept(visitor); } visitor.Visit(this); }
public void Accept(ICarElementVisitor visitor) { foreach (var part in _subparts) { part.Accept(visitor); } visitor.Visit(this); }
public void Accept(ICarElementVisitor visitor) { foreach (ICarElement carElement in _elements) { carElement.Accept(visitor); } visitor.Visit(this); }
public void Accept(ICarElementVisitor visitor) { /* * accept(CarElementVisitor) in Wheel implements * accept(CarElementVisitor) in CarElement, so the call * to accept is bound at run time. This can be considered * the first dispatch. However, the decision to call * visit(Wheel) (as opposed to visit(Engine) etc.) can be * made during compile time since 'this' is known at compile * time to be a Wheel. Moreover, each implementation of * CarElementVisitor implements the visit(Wheel), which is * another decision that is made at run time. This can be * considered the second dispatch. */ visitor.Visit(this); }
public void Accept(ICarElementVisitor visitor) { visitor.Visit(this); }