1- using Microsoft . CodeAnalysis ;
2- using Microsoft . CodeAnalysis . CSharp ;
3- using Microsoft . CodeAnalysis . CSharp . Syntax ;
1+ using System . Reflection ;
2+ using System . Runtime . InteropServices ;
3+ using System . Runtime . Versioning ;
4+
5+ using Microsoft . CodeAnalysis ;
6+ using RoslynSyntaxTool . Process ;
7+
8+ [ assembly: TargetFramework ( "net6.0" , FrameworkDisplayName = "net6.0" ) ]
9+ [ assembly: AssemblyTitle ( "RoslynSyntaxTool.Proxy.ConvertToCSharpProxy" ) ]
10+ [ assembly: AssemblyProduct ( "RoslynSyntaxTool.Proxy.ConvertToCSharpProxy" ) ]
11+ [ assembly: AssemblyCopyright ( "Copyright © MatoApp" ) ]
12+ [ assembly: ComVisible ( false ) ]
13+ [ assembly: Guid ( "9b38af72-b313-4b5b-b893-bd102c131dc6" ) ]
14+ [ assembly: AssemblyVersion ( "0.0.0.1" ) ]
15+ [ assembly: AssemblyFileVersion ( "0.0.0.1" ) ]
16+
417
518static SyntaxTree GenerateProxyTree ( )
619{
7- return SyntaxFactory . CompilationUnit ( )
8- . WithMembers (
9- SyntaxFactory . SingletonList < MemberDeclarationSyntax > (
10- SyntaxFactory . GlobalStatement (
11- SyntaxFactory . LocalFunctionStatement (
12- SyntaxFactory . IdentifierName ( "opt" ) ,
13- SyntaxFactory . MissingToken ( SyntaxKind . IdentifierToken ) )
14- . WithModifiers (
15- SyntaxFactory . TokenList (
16- new [ ] {
17- SyntaxFactory . Token ( SyntaxKind . PublicKeyword ) ,
18- SyntaxFactory . Token ( SyntaxKind . StaticKeyword ) } ) )
19- . WithBody (
20- SyntaxFactory . Block (
21- SyntaxFactory . SingletonList < StatementSyntax > (
22- SyntaxFactory . ReturnStatement (
23- SyntaxFactory . LiteralExpression (
24- SyntaxKind . StringLiteralExpression ,
25- SyntaxFactory . Literal ( "a" ) ) ) ) ) ) ) ) )
26- . NormalizeWhitespace ( ) . SyntaxTree ;
20+ return new ProxyTreeGen ( ) . Process ( ) ;
2721}
2822
2923Console . WriteLine ( GenerateProxyTree ( ) . ToString ( ) ) ;
0 commit comments