Click here to Skip to main content
15,919,358 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I am building a form which has various controls on it, and each control has various methods that are handled, such as onLoad, Click etc. When certain methods are fired, I need to write a log entry that that specific control's _something method was fired.

However, instead of adding the function call into each method, is there a way of creating a listener that will be able to react to subscribe to all the relevant controls and methods?

I have read up a bit on publisher-subscriber model etc, but it seems to be more geared towards custom events. For my solution, I need to subscribe to "built-in" events, such as _Click, _Loading etc. I do not want to add additional code into the existing methods.



Any ideas, is this even possible?



Thank you!
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900