Reputation: 4144
I'm trying to do some processing on all assemblies that own forms that are currently open in my application. I can easily get the form objects with:
System.Windows.Forms.Application.OpenForms
I want to iterate through this list and find the owning assembly for each instance. I know how to find the assembly that owns a given form class, but not a specific class instance.
Upvotes: 3
Views: 3076
Reputation: 45445
formInstance.GetType().Assembly
Edit in response to comment:
from form in Application.OpenForms
where form.Owner != null
select form.Owner.GetType().Assembly
Upvotes: 11