Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify rule S3168: Add more exceptions #4547

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions rules/S3168/csharp/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Doing so prevents control over the https://learn.microsoft.com/en-us/dotnet/csha
=== Exceptions

* Methods with the https://learn.microsoft.com/en-us/dotnet/api/system.eventhandler[`EventHandler`] delegate signature.
* Methods implementing an interface
* Methods overriding a base class method
* Virtual methods
* Methods with the https://learn.microsoft.com/en-us/dotnet/api/system.eventhandler[`EventHandler`] delegate signature
+
Using `void` for `EventHandler` is compliant with the TAP model.
+
Expand All @@ -21,9 +24,9 @@ public async void button1_Click(object sender, EventArgs e)
await DoSomethingAsync();
}
----
* Methods name matching ``++On[A-Z]\w*++`` pattern.
* Methods name matching ``++On[A-Z]\w*++`` pattern
+
Some frameworks may not use the same `EventHandler` method signature
Some frameworks may not use the same `EventHandler` method signature.
+
[source,csharp]
----
Expand Down