Ejemplo n.º 1
0
        public void Traverse(IVisitor visitor)
        {
            if (visitor == null)
            {
                throw new ArgumentNullException("visitor");
            }

            visitor.PerformBefore(this);
            m_expression.Traverse(visitor);
            visitor.PerformAfter(this);

            if (m_next != null)
            {
                m_next.Traverse(visitor);
            }
        }
Ejemplo n.º 2
0
        public void Traverse(IVisitor visitor)
        {
            if (visitor == null)
            {
                throw new ArgumentNullException("visitor");
            }

            visitor.PerformBefore(this);
            if (m_selectItems == null)
            {
                throw new InvalidOperationException(
                          "Fully-constructed query expression must have select items.");
            }

            m_selectItems.Traverse(visitor);

            visitor.PerformOnFrom(this);
            if (m_from != null)
            {
                m_from.Traverse(visitor);
            }

            visitor.PerformOnWhere(this);
            if (m_where != null)
            {
                m_where.Traverse(visitor);
            }

            visitor.PerformOnGroupBy(this);
            if (m_groupBy != null)
            {
                m_groupBy.Traverse(visitor);
            }

            visitor.PerformOnOrderBy(this);
            if (m_orderBy != null)
            {
                m_orderBy.Traverse(visitor);
            }

            visitor.PerformAfter(this);

            if (m_next != null)
            {
                m_next.Traverse(visitor);
            }
        }