Exemplo n.º 1
0
 public static EventDeclarationSyntax WithBody(
     this EventDeclarationSyntax parentSyntax,
     BlockSyntax childSyntax,
     SyntaxKind kind)
 {
     return(parentSyntax.WithAccessor(kind, parentSyntax.GetAccessor(kind).WithBody(childSyntax)));
 }
Exemplo n.º 2
0
        private static EventDeclarationSyntax CreateAccessorAttributes(
            EventDeclarationSyntax parentSyntax,
            SyntaxList <AttributeListSyntax> childSyntax,
            SyntaxKind kind)
        {
            AccessorDeclarationSyntax accessor = parentSyntax.GetAccessor(kind);

            return(parentSyntax.WithAccessor(kind, accessor.WithAttributeLists(childSyntax)));
        }