Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save juanplopes/812722 to your computer and use it in GitHub Desktop.

Select an option

Save juanplopes/812722 to your computer and use it in GitHub Desktop.
var intForm = Type.GetType("ModuloControle.IMessageForm'1").MakeGenericType(myDesiredType)
GetType().Assembly.GetTypes()
.Where(x=>!x.IsAbstract && typeof(Form).IsAssignableFrom(x) && intForm.IsAssignableFrom(x))
.Select(x => (Form)Activator.CreateInstance(x));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment