Ejemplo n.º 1
0
 protected NewingTranslationBase(NewExpression newing, ITranslationContext context)
 {
     Parameters = ParameterSetTranslation.For(
         new CtorInfoWrapper(newing.Constructor),
         newing.Arguments,
         context);
 }
Ejemplo n.º 2
0
 public static ITranslation ForDynamicMethodCall(
     ITranslation subjectTranslation,
     IMethod method,
     ICollection <Expression> arguments,
     ITranslationContext context)
 {
     return(new StandardMethodCallTranslation(
                Dynamic,
                subjectTranslation,
                method,
                ParameterSetTranslation.For(arguments, context).WithParentheses(),
                context));
 }
        public LambdaTranslation(LambdaExpression lambda, ITranslationContext context)
        {
            Type             = lambda.Type;
            _parameters      = ParameterSetTranslation.For(lambda.Parameters, context);
            _bodyTranslation = context.GetCodeBlockTranslationFor(lambda.Body);

            TranslationSize =
                _parameters.TranslationSize +
                _fatArrow.Length +
                _bodyTranslation.TranslationSize;

            FormattingSize = _parameters.FormattingSize + _bodyTranslation.FormattingSize;

            if (_bodyTranslation.IsMultiStatement == false)
            {
                _bodyTranslation.WithoutTermination();
            }
        }
Ejemplo n.º 4
0
 public static ITranslation For(RuntimeVariablesExpression runtimeVariables, ITranslationContext context)
 {
     return(ParameterSetTranslation
            .For(runtimeVariables.Variables, context)
            .WithTypes(ExpressionType.RuntimeVariables, runtimeVariables.Type));
 }