Ejemplo n.º 1
0
        public static string MapParameters(VisualBasicSyntax.ParameterListSyntax parameters, SemanticModel semanticModel,
                                           bool useLongNames = false, bool prettyPrint = true)
        {
            if (parameters == null)
            {
                return(string.Empty);
            }
            var paramList = (from VisualBasicSyntax.ParameterSyntax parameter in parameters.Parameters select MapParameter(parameter, useLongNames, semanticModel)).ToList();

            return(prettyPrint ? $"({string.Join(", ", paramList)})" : string.Join(string.Empty, paramList));
        }
Ejemplo n.º 2
0
        private static LambdaHeaderSyntax CreateFunctionHeader(SyntaxTokenList modifiers, ParameterListSyntax parameterList,
                                                               out EndBlockStatementSyntax endBlock, out SyntaxKind multiLineExpressionKind)
        {
            LambdaHeaderSyntax header;

            header = SyntaxFactory.FunctionLambdaHeader(SyntaxFactory.List <AttributeListSyntax>(),
                                                        ConvertModifiers(modifiers, SyntaxKindExtensions.TokenContext.Local), parameterList, null);
            endBlock = SyntaxFactory.EndBlockStatement(SyntaxKind.EndFunctionStatement,
                                                       SyntaxFactory.Token(SyntaxKind.FunctionKeyword));
            multiLineExpressionKind = SyntaxKind.MultiLineFunctionLambdaExpression;
            return(header);
        }
Ejemplo n.º 3
0
 public static string MapId(SyntaxToken identifier, VisualBasicSyntax.ParameterListSyntax parameters, SemanticModel semanticModel)
 {
     return(MapId(identifier.Text, parameters, semanticModel));
 }
Ejemplo n.º 4
0
 public static string MapId(string name, VisualBasicSyntax.ParameterListSyntax parameters, SemanticModel semanticModel)
 {
     return(name + ParameterMapper.MapParameters(parameters, semanticModel, true, false));
 }
Ejemplo n.º 5
0
 public static string Map(CodeItemAccessEnum access, string type, string name,
                          VisualBasicSyntax.ParameterListSyntax parameters, SemanticModel semanticModel)
 {
     return(Map(access, type, name, ParameterMapper.MapParameters(parameters, semanticModel, true)));
 }