Created
October 3, 2013 15:56
-
-
Save EdCharbeneau/6812190 to your computer and use it in GitHub Desktop.
@MLaritz: anyone know if there's a way to find in a class that implements an interface, all the public methods that aren't part of the interface? #vs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var targetType = typeof(Target); | |
targetType.GetMethods() | |
.Select(m => m.Name) | |
.Except(targetType.GetInterfaces() | |
.SelectMany(i => i.GetMethods() | |
.Select(im => im.Name))) | |
//---out | |
//ScoreGame | |
//ToString | |
//Equals | |
//GetHashCode | |
//GetType | |
public class Target : ITargetable | |
{ | |
public void BullsEye() | |
{ | |
} | |
public void ScoreGame() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment