Last active
August 29, 2015 14:26
-
-
Save glumn/86e6e09cba3d30884a62 to your computer and use it in GitHub Desktop.
Load and instantiate multiple classes as a list
This file contains hidden or 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
| 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