public void Accept(IFigureVisitor visitor) { if (ReferenceEquals(visitor, null)) { throw new ArgumentNullException(nameof(visitor)); } visitor.Visit((dynamic)this); }
public void Visit(IFigureVisitor visitor) { visitor.VisitFigure(this); foreach (IFigure figure in FiguresEnumerator) { figure.Visit(visitor); } foreach (IHandle handle in HandlesEnumerator) { visitor.VisitHandle(handle); } }
public abstract void Accept(IFigureVisitor visitor);
public override void Accept(IFigureVisitor visitor) { visitor?.Visit(this); }
public void Visit (IFigureVisitor visitor) { visitor.VisitFigure (this); foreach (IFigure figure in FiguresEnumerator) { figure.Visit (visitor); } foreach (IHandle handle in HandlesEnumerator) { visitor.VisitHandle (handle); } }
/// <summary> /// Accepts visitor instance /// </summary> /// <param name="visitor">Visitor instance for accepting</param> public void Accept(IFigureVisitor visitor) { visitor.Visit((dynamic)this); }
public virtual void AcceptVisitor(IFigureVisitor visitor) { visitor.VisitFigure (this); foreach (Figure figure in Children) figure.AcceptVisitor (visitor); foreach (IHandle handle in Handles) visitor.VisitHandle (handle); }