mattc
14th September 2009, 15:01
Hello,
what are the best practices when overriding events? Should I always call the base class implementation or not? Sometimes in the docs I read "the default implementation does nothing", but most of the time there is no indication. Of course the safest way is to always call the base class, but that's error-prone.
Also, I believe some base class implementions are meant to be called before my own code, while others should be called after (such as key press events). How do you know that? Nothing better than guessing?
Thank you
what are the best practices when overriding events? Should I always call the base class implementation or not? Sometimes in the docs I read "the default implementation does nothing", but most of the time there is no indication. Of course the safest way is to always call the base class, but that's error-prone.
Also, I believe some base class implementions are meant to be called before my own code, while others should be called after (such as key press events). How do you know that? Nothing better than guessing?
Thank you