Example #1
0
        private ConstantExpression getConstantExpression(Expression node)
        {
            ConstantExpression getConstantExpressionLocal()
            {
                IComputingInternal nestedComputing = (IComputingInternal)Expression.Lambda(node).Compile().DynamicInvoke();

                NestedComputings.Add(nestedComputing);
                return(Expression.Constant(nestedComputing, node.Type));
            }

            if (_parameterExpressions != null)
            {
                ParametersFinder parametersFinder = new ParametersFinder(_parameterExpressions);
                parametersFinder.Visit(node);

                if (!parametersFinder.ParametersFound)
                {
                    return(getConstantExpressionLocal());
                }
                else
                {
                    ContainsParametrizedObservableComputationCalls = parametersFinder.ParametersFound;
                }
            }
            else
            {
                return(getConstantExpressionLocal());
            }

            return(null);
        }
		private ConstantExpression getConstantExpression(Expression node)
		{
			ConstantExpression getConstantExpressionLocal()
			{
				return Expression.Constant(Expression.Lambda(node).Compile().DynamicInvoke(), node.Type);
			}

			if (_parameterExpressions != null)
			{
				ParametersFinder parametersFinder = new ParametersFinder(_parameterExpressions);
				parametersFinder.Visit(node);

				if (!parametersFinder.ParametersFound)
				{
					return getConstantExpressionLocal();
				}
				else
				{
					ContainsParametrizedObservableComputationCalls = parametersFinder.ParametersFound;
				}
			}
			else
			{
				return getConstantExpressionLocal();
			}

			return null;
		}