示例#1
0
        public void Accept(IFigureVisitor visitor)
        {
            if (ReferenceEquals(visitor, null))
            {
                throw new ArgumentNullException(nameof(visitor));
            }

            visitor.Visit((dynamic)this);
        }
示例#2
0
        public void Visit(IFigureVisitor visitor)
        {
            visitor.VisitFigure(this);

            foreach (IFigure figure in FiguresEnumerator)
            {
                figure.Visit(visitor);
            }

            foreach (IHandle handle in HandlesEnumerator)
            {
                visitor.VisitHandle(handle);
            }
        }
示例#3
0
 public abstract void Accept(IFigureVisitor visitor);
示例#4
0
 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);
			}
		}
示例#6
0
 /// <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);
        }