TryGetLocal() public method

public TryGetLocal ( string name, System.Linq.Expressions.ParameterExpression &local ) : bool
name string
local System.Linq.Expressions.ParameterExpression
return bool
示例#1
0
        Expr IExpressionVisitor <Expr> .Visit(Expression.Varargs expression)
        {
            ParamExpr param;

            if (scope.TryGetLocal(Constant.VARARGS, out param))
            {
                return(param);
            }
            return(Expr.Constant(null));
        }
示例#2
0
        public bool TryGetLocal(string name, out ParamExpr local)
        {
            if (variables.TryGetValue(name, out local))
            {
                return(true);
            }
            if (parent != null)
            {
                return(parent.TryGetLocal(name, out local));
            }

            return(false);
        }