当前位置: 首页>>代码示例>>C#>>正文


C# ExpressionVisitor.Visit方法代码示例

本文整理汇总了C#中System.Linq.Expressions.ExpressionVisitor.Visit方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionVisitor.Visit方法的具体用法?C# ExpressionVisitor.Visit怎么用?C# ExpressionVisitor.Visit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Linq.Expressions.ExpressionVisitor的用法示例。


在下文中一共展示了ExpressionVisitor.Visit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitChildren

        /// <summary>
        ///     Reduces the node and then calls the <see cref="ExpressionVisitor.Visit(System.Linq.Expressions.Expression)" /> method passing the
        ///     reduced expression.
        ///     Throws an exception if the node isn't reducible.
        /// </summary>
        /// <param name="visitor"> An instance of <see cref="ExpressionVisitor" />. </param>
        /// <returns> The expression being visited, or an expression which should replace it in the tree. </returns>
        /// <remarks>
        ///     Override this method to provide logic to walk the node's children.
        ///     A typical implementation will call visitor.Visit on each of its
        ///     children, and if any of them change, should return a new copy of
        ///     itself with the modified children.
        /// </remarks>
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            visitor.Visit(_tableExpression);
            visitor.Visit(_predicate);

            return this;
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:20,代码来源:JoinExpressionBase.cs

示例2: VisitChildren

        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newLeft = visitor.Visit(Left);
            var newRight = visitor.Visit(Right);

            return newLeft != Left || newRight != Right
                ? new StringCompareExpression(Operator, newLeft, newRight)
                : this;
        } 
开发者ID:491134648,项目名称:EntityFramework,代码行数:9,代码来源:StringCompareExpression.cs

示例3: VisitChildren

        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newMatchExpression = visitor.Visit(Match);
            var newPatternExpression = visitor.Visit(Pattern);

            return (newMatchExpression != Match)
                   || (newPatternExpression != Pattern)
                ? new LikeExpression(newMatchExpression, newPatternExpression)
                : this;
        }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:10,代码来源:LikeExpression.cs

示例4: VisitChildren

        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newMatchExpression = visitor.Visit(Match);
            var newPatternExpression = visitor.Visit(Pattern);

            return newMatchExpression != Match
                   || newPatternExpression != Pattern
                ? new RegexMatchExpression(newMatchExpression, newPatternExpression, Options)
                : this;
        }
开发者ID:yonglehou,项目名称:Pomelo.EntityFrameworkCore.MyCat,代码行数:10,代码来源:RegexMatchExpression.cs

示例5: VisitChildren

        protected override Expression VisitChildren(ExpressionVisitor visitor) {
            Expression left = visitor.Visit(_left);
            Expression right = visitor.Visit(_right);

            if (left != _left || right != _right) {
                return new AssignmentExtensionExpression(left, right);
            }

            return this;
        }
开发者ID:bclubb,项目名称:ironruby,代码行数:10,代码来源:AssignmentExpression.cs

示例6: VisitChildren

        /// <summary>
        /// Loop in and make sure the sub-expressions are correctly "visited" - mainly the
        /// low and high guys.
        /// </summary>
        /// <param name="visitor"></param>
        /// <returns></returns>
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var nLowBoundary = visitor.Visit(LowBoundary);
            var nHighBoundary = visitor.Visit(HighBoundary);

            if (nLowBoundary == LowBoundary && nHighBoundary == HighBoundary)
            {
                return this;
            }

            // Changed, so clone ourselves.
            return new EnumerableRangeExpression(nLowBoundary, nHighBoundary);
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:19,代码来源:EnumerableRangeExpression.cs

示例7: VisitChildren

		protected override Expression VisitChildren(ExpressionVisitor visitor)
		{
			QueryNode newTarget = (QueryNode)visitor.Visit(Target);
			LambdaExpression[] newConditions = new LambdaExpression[Conditions.Count];
			bool unchanged = (newTarget == Target);
			for (int i = 0; i < newConditions.Length; i++) {
				newConditions[i] = (LambdaExpression)visitor.Visit(Conditions[i]);
				unchanged &= newConditions[i] == Conditions[i];
			}
			if (unchanged)
				return this;
			else
				return new Filter(newTarget, newConditions);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:14,代码来源:Filter.cs

示例8: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression v = visitor.Visit(_value);
     if (v == _value) {
         return this;
     }
     return Utils.MakeYield(_target, v, YieldMarker);
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:7,代码来源:YieldExpression.cs

示例9: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     var instance = visitor.Visit(_expr);
     if (instance != _expr) {
         return new LightCheckAndThrowExpression(instance);
     }
     return this;
 }
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:LightCheckAndThrowExpression.cs

示例10: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression v = visitor.Visit(_variable);
     if (v == _variable) {
         return this;
     }
     return Utils.Delete(v);
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:DeleteStatement.cs

示例11: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression b = visitor.Visit(_body);
     if (b == _body) {
         return this;
     }
     return new FinallyFlowControlExpression(b);
 }
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:FinallyFlowControlExpression.cs

示例12: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression body = visitor.Visit(_body);
     if (body == _body) {
         return this;
     }
     return new SkipInterpretExpression(body);
 }
开发者ID:apboyle,项目名称:ironruby,代码行数:7,代码来源:SkipInterpretExpression.cs

示例13: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     Expression v = visitor.Visit(_value);
     if (v == _value) {
         return this;
     }
     return Utils.Assign(_name, v);
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:UnboundAssignment.cs

示例14: VisitChildren

 protected override Expression VisitChildren(ExpressionVisitor visitor) {
     var expr = visitor.Visit(_expr);
     if (expr != _expr) {
         return new LightExceptionConvertingExpression(expr, _supportsLightEx);
     }
     return this;
 }
开发者ID:madpilot,项目名称:ironruby,代码行数:7,代码来源:LightExceptionConvertingExpression.cs

示例15: VisitChildren

        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            var newInnerExpression = visitor.Visit(_expression);

            return newInnerExpression != _expression 
                ? new AliasExpression(Alias, newInnerExpression)
                : this;
        }
开发者ID:491134648,项目名称:EntityFramework,代码行数:8,代码来源:AliasExpression.cs


注:本文中的System.Linq.Expressions.ExpressionVisitor.Visit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。