Determine caller class name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • qingxun@gmail.com

    #1

    Determine caller class name

    Hi!

    Is there a way in VB.NET to determine the caller's class name?

    System.Reflecti on.MethodBase.G etCurrentMethod .GetType basically telling
    me what is my current executing class, but I wanted to know, which
    caller class invoke my existing class method.

    Any help is much appreciated.


    Bob

  • Phill W.

    #2
    Re: Determine caller class name

    qingxun@gmail.c om wrote:
    [color=blue]
    > Is there a way in VB.NET to determine the caller's class name?[/color]

    Why? Code within any given method should not care how or from where it
    was called.

    If you need to do things differently within a method based on a given
    value, pass that value as an argument to the method (you could, of
    course, pass a reference to the calling object!).

    Regards,
    Phill W.

    Comment

    Working...