コード例 #1
0
        public override PropertyDeclarationSyntax EmitSyntax()
        {
            OutputSyntax = SyntaxFactory.PropertyDeclaration(
                Member.PropertyType.GetTypeNameSyntax(),
                SyntaxFactory.Identifier(Member.Name)
                );

            OutputSyntax = OutputSyntax.WithModifiers(EmitMemberModifiers());

            OutputSyntax = OutputSyntax.WithAccessorList(
                SyntaxFactory.AccessorList(
                    SyntaxFactory.List <AccessorDeclarationSyntax>(new[] {
                SyntaxFactory.AccessorDeclaration(SyntaxKind.GetAccessorDeclaration)
                .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)),
                SyntaxFactory.AccessorDeclaration(SyntaxKind.SetAccessorDeclaration)
                .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
            })
                    )
                );

            return(OutputSyntax);
        }
コード例 #2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public override PropertyDeclarationSyntax EmitSyntax()
        {
            OutputSyntax = PropertyDeclaration(
                Member.PropertyType.GetTypeNameSyntax(),
                Identifier(Member.Name)
                );

            OutputSyntax = OutputSyntax.WithModifiers(EmitMemberModifiers());

            OutputSyntax = OutputSyntax.WithAccessorList(
                AccessorList(
                    SingletonList <AccessorDeclarationSyntax>(
                        AccessorDeclaration(
                            SyntaxKind.GetAccessorDeclaration
                            )
                        .WithSemicolonToken(
                            Token(SyntaxKind.SemicolonToken)
                            )
                        )
                    )
                );

            return(OutputSyntax);
        }