コード例 #1
0
        string Render(Docs docs, params Parameter[] parameters)
        {
            Method method = new Method(
                parameters: parameters,
                docs: docs,
                name: "method"
                );

            MethodDocCommentGenerator generator = new MethodDocCommentGenerator(method, Symbols);

            SyntaxTrivia docComment = generator.CreateDocComment();
            SyntaxTree   tree       = SF.SyntaxTree(
                SF.MethodDeclaration(SF.ParseTypeName("void"), "Method")
                .WithLeadingTrivia(generator.CreateDocComment())
                .NormalizeWhitespace(elasticTrivia: true)
                );

            return(tree.ToString());
        }
コード例 #2
0
        public MethodDeclarationSyntax CreateMethod()
        {
            MethodDeclarationSyntax declaration = SF.MethodDeclaration(
                GetAttributeLists(),
                GetModifierList(),
                GetReturnType(),
                GetExplicitInterfaceSpecifier(),
                GetIdentifier(),
                GetTypeParameterList(),
                Method.GetParameterListSyntax(Namespaces, Symbols),
                GetConstraintClauseList(),
                GetBody(),
                GetExpressionBody(),
                GetSemicolonToken()
                );

            MethodDocCommentGenerator generator = new MethodDocCommentGenerator(Method, Symbols);
            SyntaxTriviaList          trivia    = SF.TriviaList(generator.CreateDocComment());

            declaration = declaration.WithLeadingTrivia(trivia);

            return(declaration);
        }