开发者

Catch events by dynamically adding Handler using Code Generation

开发者 https://www.devze.com 2023-01-20 14:19 出处:网络
I need to hook up all events in an application and trace all information (raising, arguments, etc.). I found this at Stackoverflow:

I need to hook up all events in an application and trace all information (raising, arguments, etc.).

I found this at Stackoverflow: Tracing all events in VB.NET

However, I need a solution that not only writes the called event to console, but calls TraceVerbose with parameters showing sender and eventargs.

I am still working on getting to know dynamic code generation and IL, so I don't have a clue about how t开发者_如何学编程o get the code to call a trace method with parameters from the event.

Can anyone tell me how to do this (in VB.NET)?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号