public static async Task ComputeRefactoringAsync(RefactoringContext context, EventDeclarationSyntax eventDeclaration) { if (!eventDeclaration.HasSingleLineDocumentationComment()) { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); IEventSymbol eventSymbol = semanticModel.GetDeclaredSymbol(eventDeclaration); if (eventSymbol?.IsErrorType() == false) { ComputeRefactoring <IEventSymbol>(context, eventDeclaration, eventSymbol, eventSymbol.OverriddenEvent); } } }
public static async Task ComputeRefactoringAsync(RefactoringContext context, EventDeclarationSyntax eventDeclaration) { if (!eventDeclaration.HasSingleLineDocumentationComment()) { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); BaseDocumentationCommentInfo info = DocumentationCommentGenerator.GenerateFromBase(eventDeclaration, semanticModel, context.CancellationToken); if (info.Success) { RegisterRefactoring(context, eventDeclaration, info); } } }
public override SyntaxNode VisitEventDeclaration(EventDeclarationSyntax node) { bool isPubliclyVisible = node.IsPubliclyVisible(); node = (EventDeclarationSyntax)base.VisitEventDeclaration(node); if (isPubliclyVisible && !node.HasSingleLineDocumentationComment()) { return(DocumentationCommentGenerator.GenerateAndAttach(node, _settings)); } else { return(node); } }
public override SyntaxNode VisitEventDeclaration(EventDeclarationSyntax node) { bool isPubliclyVisible = node.IsPubliclyVisible(); node = (EventDeclarationSyntax)base.VisitEventDeclaration(node); if (isPubliclyVisible && !node.HasSingleLineDocumentationComment()) { return(AddDocumentationComment(node)); } else { return(node); } }