예제 #1
0
        public override SyntaxNode VisitEventFieldDeclaration(EventFieldDeclarationSyntax node)
        {
            base.VisitEventFieldDeclaration(node);

            if (node.Parent is InterfaceDeclarationSyntax)
                return node;

            var symbol = semanticModel.GetDeclaredSymbol((node as EventFieldDeclarationSyntax).Declaration.Variables[0]);

            var type = symbol.ContainingType;
            if (type == null)
                return node;

            var faceMembers = symbol.ImplementedInterfaceMember();
            if (faceMembers.Count() != 1)
                return node;

            var facenode = faceMembers.Single().GetSyntaxNodes().Single().Parent.Parent;
            if (facenode.GetDocumentationCommentText().Length == 0 ||
                node.GetDocumentationCommentText().WithoutIndentation() == facenode.GetDocumentationCommentText().WithoutIndentation())
                return node;

            return node.WithDocumentationComment(facenode.GetDocumentationCommentText());
        }