In .Net the Component
class exposes a Disposed
event. It also provides a protected member OnDispose(bool disposing)
.
What is the best practice for a custom component that extends Component
? Override OnDispose(bool)
or attach an event handler to Disposed
on construction?
My feeling is that one should override OnDispose(bool)
and seal the class.
Thoughts?