public T Accept <T>(Func <ICarVisitor <T> > visitorFactory) { ICarVisitor <T> visitor = visitorFactory(); Accept(() => (ICarVisitor)visitor); return(visitor.ProduceResult()); }
public void Accept(ICarVisitor v) { foreach (var e in _items) { e.Accept(v); } v.Visit(this); }
public static void Accept(this Car car, ICarVisitor visitor) { car.engine.Accept(visitor); foreach (Seat seat in car.seats) { seat.Accept(visitor); } // visitor.VisitCar(car.make, car.model); visitor.Visit(car); }
public void Accept(Func <ICarVisitor> visitorFactory) { ICarVisitor visitor = visitorFactory(); engine.Accept(() => visitor); foreach (Seat seat in seats) { seat.Accept(() => visitor); } visitor.VisitCar(make, model); }
public void PerformOperation(ICarVisitor visitor) { visitor.ChargeCreditCardEveryTimeCigaretteLighterIsUsed(this); }
public void PerformOperation(ICarVisitor visitor) { visitor.StickAccelerator(this); }
public void Accept(ICarVisitor v) { v.Visit(this); }