Search The Blog
Latest Posts
Twitter: @RoyOsherove
About this site

TDD in .NET Online Course

TDD and BDD in Ruby Online Course



This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

« StackOVerflow Notifier | Main | SharpMock 0.1 ? »

Use Reflection to find Methods that implement explicit interfaces

update: added a check for IsPrivate based on the comments.

so I won't forget: here's how you can iterate over a type definition's methods and see if one of them is an explicit intreface definition:


foreach (var info in GetType().GetMethods(
   if (info.IsFinal && info.IsPrivate)
         Console.WriteLine("Explicit interface implementation: {0}", info.Name);


this will show only the "Write" method for the following class:

public class Class1 : ILogger
public void show()
void MyMethod()
void ILogger.Write(string s)

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Web Analytics