Chia Huang

Chia Huang

  • NA
  • 3
  • 0

To identify the Function Caller

Jul 18 2006 6:10 AM
Hi all, I'm new to this forum as well as to the language C#. I'm hoping to learn from the experts here.

Ok, this is what I have to do. I need to indentify who calls the function and take corresponding actions to the callers.

To make it more clear, I need to indetify who calls the Dispose() function of a Form. What I need to do is, if the user click on "Quit", which I provide and calls the Dispose() function, on the Form, it disposes the form in one way. However, if the user reboot or shuts down the PC which the From is till running, the OS would call Dispose() also but then I will have to take some other actions when the caller of Dispose function is the OS. So I must determine who's the caller of the dispose function to take corresponding actions.

Any suggestions would be much appreciated. Thanks for you guys' help in advance.

Answers (2)