Skip to content

Commit

Permalink
Modify rule S3168: Add more exceptions (#4547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Pohlmann authored Dec 2, 2024
1 parent 55c1242 commit a007e43
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit a007e43

Please sign in to comment.