Who is my calling object?

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.
 
J

John Saunders

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top