Sonar Source rule 3906 Event Handlers should have the correct signature
Sonar Source code static analysis rule RSPEC-3906 states:
Delegate event handlers (i.e. delegates used as type of an event) should have a very specific signature:
The problem was that I was getting the warning on a simple event declared as EventHandler<TEventArgs>. Going to its source code page revealed the reason in a comment: // Removed TEventArgs constraint post-.NET 4.
Delegate event handlers (i.e. delegates used as type of an event) should have a very specific signature:
- Return type void.
- First argument of type System.Object and named 'sender'.
- Second argument of type System.EventArgs (or any derived type) and is named 'e'.
The problem was that I was getting the warning on a simple event declared as EventHandler<TEventArgs>. Going to its source code page revealed the reason in a comment: // Removed TEventArgs constraint post-.NET 4.
Comments
I appreciate the fact that you didn't just drop a link to an ad site, but I am not interested in any money for my blog. It's purely what I choose to share with the world. Thanks for the offer, but I will have to decline. This blog will always be ad free.
SideriteHi Costin - for someone who is interested in programming I think you'll like what Ezoic has to offer. Our technology is a layer of machine learning that provides each of your visitors with a unique combination of ad sizes, locations, number of ads based on how they engage with the site. Dynamically adjusting the ad layout increases ad revenue (typical uplift is 60-150%) while improving user engagement. I'd like to offer the opportunity to run a free pilot of Ezoic's technology on http://siderite.dev (siderite.dev | siderite.dev); what's the best way to schedule a call or would you prefer some info via email? Cheers, Piper
Piper Lofrano