Who is my calling object?

  • Thread starter Thread starter Bob L.
  • Start date Start date
B

Bob L.

Hi everyone,

I am implementing I method where it would be convenient to get the instance
of the object that is calling me. I know I can get the calling method using
the StackFrame class, and I can get the calling assembly, but what about the
instance of the object which implements the calling method?

Thanks,
Bob L.
 
Bob L. said:
Hi everyone,

I am implementing I method where it would be convenient to get the
instance
of the object that is calling me. I know I can get the calling method
using
the StackFrame class, and I can get the calling assembly, but what about
the
instance of the object which implements the calling method?

Have the calling object pass itself as a parameter. Believe me when I tell
you that you don't want to limit yourself to operating on the calling object
only. There may come a day when some intermediate object will be introduced.

John Saunders
 
Back
Top