/// <summary>
        ///
        /// </summary>
        /// <param name="invokeeName"></param>
        /// <param name="arguments"></param>
        /// <returns></returns>
        public static ITranslationUnit BuildObjectCreationExpressionTranslationUnit(ITranslationUnit type, ITranslationUnit[] arguments)
        {
            var translationUnit = ObjectCreationExpressionTranslationUnit.Create(type);

            if (arguments != null)
            {
                foreach (ITranslationUnit argument in arguments)
                {
                    translationUnit.AddArgument(argument);
                }
            }

            return(translationUnit);
        }
Beispiel #2
0
        private static ITranslationUnit BuildObjectCreationExpressionTranslationUnit(ObjectCreationExpressionSyntax expression, SemanticModel semanticModel)
        {
            ObjectCreationExpression helper = new ObjectCreationExpression(expression, semanticModel);

            var translationUnit = ObjectCreationExpressionTranslationUnit.Create(
                TypeIdentifierTranslationUnit.Create(helper.Type.FullName.MapType().MappedType.Translate())); // TODO: Create factory for TypeReference

            foreach (var argument in helper.Arguments)
            {
                var argumentTranslationUnit = new ExpressionTranslationUnitBuilder(argument.Expression, semanticModel).Build();

                translationUnit.AddArgument(argumentTranslationUnit);
            }

            return(translationUnit);
        }