|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to get the namespace inside a static method?Hi there,
I have a class with a static method, how can I find the namespace of the class from inside the method. TIA static string GetNamespace(){
return new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().DeclaringType.Namespace; } Try the above Ciaran O'Donnell Show quote "Kevin" wrote: > Hi there, > > I have a class with a static method, how can I find the namespace of the > class from inside the method. > > TIA > ^_^
Works great, thanks Ciaran. Ciaran O''Donnell wrote: Show quote > static string GetNamespace(){ > return new > System.Diagnostics.StackTrace().GetFrame(0).GetMethod().DeclaringType.Namespace; > } > > Try the above > > Ciaran O'Donnell > > "Kevin" wrote: > >> Hi there, >> >> I have a class with a static method, how can I find the namespace of the >> class from inside the method. >> >> TIA >> |
|||||||||||||||||||||||