Sometimes I override methods in base classes. Sometimes I even override them with an empty method, because what I want is to prevent the behavior.
In the past I would write something like this to show the intent of bypassing the base method:
protected override void OnMouseUp(MouseEventArgs e)
{
// base.OnMouseUp(e);
}
(I know a commented line of code is a bad thing. I used to do it)
But I want to do better:
<summary>
?) documentation?For documentation, I would just use the built-in documentation tags:
/// <summary>Exiting drag mode on mouse up</summary>
protected override void OnMouseUp(MouseEventArgs e)
{
...
For clarifying the intention I would just put a comment like
protected override void OnMouseUp(MouseEventArgs e)
{
// not calling the base implementation
...
}
The line
// base.OnMouseUp(e);
makes an impression that the call is commented out temporarily (and perhaps someone forgot to restore it back)
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