dotnet / dotnet/sdk

Intention behind "EventHandler" in CA1711 ?

Open
#54,103 7 comments 0 reactions 0 assignees View on GitHub
Area-Microsoft.CodeAnalysis.NetAnalyzers untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

I first posted in the wrong repo: https://github.com/dotnet/docs/issues/53193
therefore, I post again here.

I have created a class named EventHandler, which IMHO does not require more text in its name, since it is a nested class inside another class with meaningful name.

The analyzer now complains about the name (CA1711). What is the reason for having "EventHandler" in CA1711? I guess dozens, if not hundrets of classes in .NET carry the text "EventHandler" as part of their name, so these violate that rule, e.g.:

ContextMenuEventHandler
InitializingNewItemEventHandler
TextChangedEventHandler
ToolTipEventHandler

(from System.Windows.Controls)

... (many!)

(from System.Windows.Forms)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.