Esempio 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));
        }
Esempio 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);
        }
Esempio n. 3
0
 public static string MapId(SyntaxToken identifier, VisualBasicSyntax.ParameterListSyntax parameters, SemanticModel semanticModel)
 {
     return(MapId(identifier.Text, parameters, semanticModel));
 }
Esempio n. 4
0
 public static string MapId(string name, VisualBasicSyntax.ParameterListSyntax parameters, SemanticModel semanticModel)
 {
     return(name + ParameterMapper.MapParameters(parameters, semanticModel, true, false));
 }
Esempio 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)));
 }