Richard Ward <ne*******@happysphinx.co.uk> wrote:
I want to pull the name of the namespace a method is defined in from
inside the method itself. MSDN say to use ISymbolMethod.GetNamespace.
Where does it say that?
However, how do I get a reference to ISymbolMethod interface.
Anybody got an example?
I don't think you want ISymbolMethod at all. Just use
MethodBase.GetCurrentMethod().ReflectedType.Namesp ace
Note the use of ReflectedType rather than DeclaringType - you may want
to experiment to get the exact desired behaviour, depending on
overriding etc.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too