Static methods; access to class & method name ?

  • Thread starter Thread starter Barry Mossman
  • Start date Start date
B

Barry Mossman

Hi, is there a way to get access to the class name and method name of a
static method from within itself ? ie. the equivalent of this.ToString()
in a instance method.

thanks
Barry Mossman
 
Barry,
Hi, is there a way to get access to the class name and method name of a
static method from within itself ? ie. the equivalent of this.ToString()
in a instance method.

MethodBase.GetCurrentMethod().Name
MethodBase.GetCurrentMethod().DeclaringType.Name



Mattias
 
Mattias Sjögren said:
MethodBase.GetCurrentMethod().Name
MethodBase.GetCurrentMethod().DeclaringType.Name

Great, that did it. Thanks Mattias

regards
Barry Mossman
 
Back
Top