Skip to content

Instantly share code, notes, and snippets.

@glumn
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save glumn/86e6e09cba3d30884a62 to your computer and use it in GitHub Desktop.

Select an option

Save glumn/86e6e09cba3d30884a62 to your computer and use it in GitHub Desktop.
Load and instantiate multiple classes as a list
Dim tAssembly = Assembly.GetExecutingAssembly()
Dim tScripts = tAssembly.GetTypes() _
.Where(Function(t) t.GetInterfaces().Contains(GetType(IScriptInterface))) _
.Select(Function(t) CType(Activator.CreateInstance(t), IScriptInterface))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment