Skip to content

Instantly share code, notes, and snippets.

@iggym
Created December 18, 2012 20:41
Show Gist options
  • Save iggym/4331765 to your computer and use it in GitHub Desktop.
Save iggym/4331765 to your computer and use it in GitHub Desktop.
all types implementing an interface
//Loop assemblies ,loop types, check if implemented
var type = typeof(IMyInteraface);
var types = AppDomain.CurrentDomain.GetAssemblies().ToList()
.SelectMany(s => s.GetTypes())
.Where(p => type.IsAssignableFrom(p));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment