Finding my type

M

mike.spertus

GetType() works in non-static methods, but how do I get my type in non-static methods?

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
J

Jay B. Harlow [MVP - Outlook]

Mike,
Have you tried using StackFrame.GetMethod().DeclaringType for static
methods?

For instance methods I would probably continue to use this.GetType.

Although I see little value of a static method to know the type it is
declared in...

Hope this helps
Jay

Mike Spertus said:
GetType() works in non-static methods, but how do I get my type in non-static methods?

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 

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