From 8597396a972b890460146d056c98b869faca0e10 Mon Sep 17 00:00:00 2001 From: Tim Pohlmann Date: Thu, 28 Nov 2024 11:48:54 +0100 Subject: [PATCH] Add more exceptions --- rules/S3168/csharp/rule.adoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rules/S3168/csharp/rule.adoc b/rules/S3168/csharp/rule.adoc index b29cdfb0b8a..7ea6d6b2f59 100644 --- a/rules/S3168/csharp/rule.adoc +++ b/rules/S3168/csharp/rule.adoc @@ -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. + @@ -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] ----