In the code I have to maintain ("Lucky Man" by ELP definitely does not fit this soundtrack), I see this, grayed out (not commented out -- grayed out by the compiler or Resharper):
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
An orange light bulb glyph (Resharper?) msg says about it, "Remove redundant method override"
A skyblue circular glyph with a "0" inside says:
"Overrides method from class 'System.ComponentModel.Component" -and: "Overrides method from class 'System.Windows.Forms.Control"
I take it what it is saying is that this override does nothing beyond what the method it's overriding does, and thus I can remove it entirely. Am I right?
Since you're just calling the base method, there's no reason for that code to be there, hence it can be removed.
I realize that this is an old question but just wanted to add a tiny detail here. If you derive another class from your derived class you will not be able to call base.Dispose from that one unless you keep the "redundant" function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With