コード例 #1
0
            public OutParameterTranslation(Expression parameter, ITranslationContext context)
            {
                _parameterTranslation = context.GetTranslationFor(parameter);
                TranslationSize       = _parameterTranslation.TranslationSize + _out.Length;
                FormattingSize        = _parameterTranslation.FormattingSize + context.GetKeywordFormattingSize();

                if ((parameter.NodeType == Parameter) &&
                    context.Settings.DeclareOutParamsInline &&
                    context.ShouldBeDeclaredInline((ParameterExpression)parameter))
                {
                    _declareParameterInline = true;

                    if (context.Settings.UseImplicitTypeNames)
                    {
                        TranslationSize += _var.Length;
                        FormattingSize  += context.GetKeywordFormattingSize();
                        return;
                    }

                    _typeNameTranslation = context.GetTranslationFor(parameter.Type);
                    TranslationSize     += _typeNameTranslation.TranslationSize + 1;
                    FormattingSize      += _typeNameTranslation.FormattingSize;
                }
            }