Reflection: get Static method from the parent class.

Posted by jitm on Stack Overflow See other posts from Stack Overflow or by jitm
Published on 2010-05-12T09:40:58Z Indexed on 2010/05/12 9:44 UTC
Read the original article Hit count: 215

Filed under:
|

Hello, I have task to get static method using reflection like this :

myType.GetMethod("MyMethod",BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod);

In case if class contains MyMethod all works correctly, but in case if parent class contains MyMethod I receive null :(. How can I call static method from the parent using reflection like code that I describe above? Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about reflection