Exemplo n.º 1
0
 public override SyntaxNode VisitPropertyDeclaration(PropertyDeclarationSyntax node)
 {
     return base.VisitPropertyDeclaration(
         node.WithType(UpdateType(node.Type))
             .WithModifiers(SyntaxFactory.TokenList())
             .WithAccessorList(UpdateAccessorList(node.AccessorList, node.Type)));
 }
        private static SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
        {
            TypeSyntax type = node.Type;
            if (type == null || type.IsMissing)
            {
                return null;
            }

            SyntaxTokenList modifiers = DeclarationModifiersHelper.AddModifier(node.Modifiers, ref type, SyntaxKind.PrivateKeyword);
            return node
                .WithType(type)
                .WithModifiers(modifiers)
                .WithoutFormatting();
        }