Getting classes running

  • Thread starter Thread starter toki
  • Start date Start date
T

toki

public class Form1 : System.Windows.Forms.Form
{
MyClass myclass;

public Form1()
{
myclass = new MyClass();
}
}

In one moment i need to know all the classes created. How
can i know this. I can get all the controls with
System.Collections.IEnumerator enume =
this.Controls.GetEnumerator();

but what about the classes?

Thanks,
 
Are you truly referring to all classes instantiated? Only your or the
entire framework? There are a lot of classes that get loaded in to the
system, both yours and the systems, but I do not think that there is a way
to determine the classes that are loaded.

Maybe you can provide more detail into your problem and someone may come up
with an awesome solution.

Basically, if there are only certain classes that you want to keep track of,
you might want to wrap their creation in some factor class that maintains a
reference to the class for later use.
 
*spanish*
I need to make a user control that adjust some paremeters
of some (equals) COM objects created in run-time on a main
form.
This COM objects can be stored in an array like not.

Xtend[] xtend = new Xtend[10];
Xtend xtend1 = new Xtend();

I need to wrap all these "Xtend" COM object in order to
enumerate it and load it in a list box to bla bla...

I know how to access to the forms controls with
System.Collections.IEnumerator enume =
this.Controls.GetEnumerator();

but i have not idea how can i wrap my run-time COM objects.

Very Thanks,
 
toki, if you just want to know the assemblies loaded for your AppDomain you
could use AppDomain.GetAssemblies(). Once you know that you can find out
what classes are in each assembly using reflection. You could also call
GetLoadedModules() on each of the Assemblies to find out which modules have
been loaded. You won't be able to find out what actual classes have been
invoked with all of that though. I don't think there is a way to do that
without querying the CLR. Anyone else know how to get that info?
 
Back
Top