HighTechTalks DotNet Forums  

Type.GetMethod("GetMethod") does work

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss Type.GetMethod("GetMethod") does work in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Nick
 
Posts: n/a

Default Type.GetMethod("GetMethod") does work - 07-10-2003 , 04:29 AM






Hi,

I have a Type reference and I want to actually get the MethodInfo for the
method GetMethod, but it comes back as null. I am assuming that GetMethod
works on the class it is the type for, and only searchs that class rather
than the system part of type. It seems like I need a Meta-Type to allow me
to access the MethodInfo for GetMethod. Does anybody know how to do this?

Thanks!

Nick.



Reply With Quote
  #2  
Old   
Dino Chiesa [MSFT]
 
Posts: n/a

Default Re: Type.GetMethod("GetMethod") does work - 07-10-2003 , 11:26 AM






it works for me...

"Mattias Sjögren" <mattias.dont.want.spam (AT) mvps (DOT) org> wrote

Quote:
Nick,

It seems like I need a Meta-Type to allow me
to access the MethodInfo for GetMethod. Does anybody know how to do
this?

Do you mean

typeof(System.Type).GetMethod("GetMethod")



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.



Reply With Quote
  #3  
Old   
Jon Skeet
 
Posts: n/a

Default Re: Type.GetMethod("GetMethod") does work - 07-10-2003 , 12:12 PM



Willy Denoyette [MVP] <willy.denoyette (AT) skynet (DOT) be> wrote:
Quote:
Not for me:

typeof(System.Type).GetMethod("System.Type.GetMeth od");

Returns a null reference......
That's because System.Type.GetMethod isn't the name of the method -
GetMethod is the name of the method.

--
Jon Skeet - <skeet (AT) pobox (DOT) com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.