2

I am working with some legacy code that Console.Write and Console.WriteLine are used a lot. I would like to fire an event every time this method is called.

That said, I went to the OpenSource library and found out that there isnt an event that is fired when this is called. So my question is:

Is there a way to change the code that this applicaion is using to fire an event every time this is called?

Or, if not, is there a way to do this without changing the code?

Community
  • 1
  • 1
3xGuy
  • 2,235
  • 2
  • 29
  • 51
  • As alternative: https://stackoverflow.com/questions/6169552/is-there-a-way-to-hook-a-managed-function-in-c-sharp-like-i-would-a-unmanaged-fu#6171718 ;-) – Stefan Aug 27 '18 at 19:51

0 Answers0