In my abstract class can I listen an abstract method and fire an event whenever that method is called? If yes how?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not really as an abstract method is always overidden and there is no guarantee that the override call
base.Method()to an implementation of it.Your best bet is to create a virtual method which raises the event and then make all your overrides call
base.Method()If you want to intercept the method call, here is a question about how to do that.