-1

If we don't check the EventArgs in a protected event handler, FxCop raises CA1062:

Validate arguments of public methods

Yes, someone could theoretically inherit from my page class and call my protected event handling method as though it were a standard function. Dude, I don't care.

Suppress it?

sq33G
  • 3,320
  • 1
  • 23
  • 38

1 Answers1

1

Many FxCop rules are suggestions, not hard rules. If you disagree in a specific case, suppress it specifically. If you disagree generally, disable the rule.

That being said, I wouldn't suppress CA1062. There is a really easy fix, that doesn't touch the public interface of your method.

driis
  • 161,458
  • 45
  • 265
  • 341
  • Marking as answer, 'cause it's good enough. I'm still going to fight this one out at work because there are so many violations like this currently existing in the code, and I can think of a better way to keep the team busy. – sq33G Nov 14 '11 at 13:46