Ignore event handler for S1172 (remove this unused method parameter)

The csharpsquid sonar rule: S1172 (remove this unused method parameter) is also selected for event handlers, such as:

protected void Button_Click(object sender, EventArgs e)
{
    DoSomething()
}

Is there a way for a rule to ignore event handlers since they are automatically generated in this way?

+4
source share
1 answer

There is currently no way to ignore event handlers, but we fixed this problem in the upcoming version, so event handlers with a standard signature (2 parameters, the second EventArgsor derivative, and returns void)) are not displayed for S1172.

+2
source

Source: https://habr.com/ru/post/1618286/


All Articles