I searched, but only saw some code for java.
How can this be done in C#?
Thanks!!
Printable View
I searched, but only saw some code for java.
How can this be done in C#?
Thanks!!
Are you talking about writing code to that at run time? If so I don't see how it's practically possible. If you don't have a reference to an assembly in your project then your app can't query that assembly to know anything about what it contains. Therefore you'd have to reference every assembly in the Framework in order to do it. I'd assume that you would then have to use reflection to test every class to see if it implemented the interface using Type.GetInterface.
You'll need to loop through the classes in the assembly. To check if it implements an interface, say
if(typeof(classname) is interfacename)
{
//
}
Check this thread for assembly information through reflection
http://www.vbforums.com/showthread.p...ght=reflection
It's in VBCode, but I'm sure you can conver it.
That makes perfect sense. No wonder I didn't think of it. :sick:Quote:
Originally Posted by mendhak
How do you start it out and set the type to "System". I tried several things, but none were right. It does sound weird because system is a namespace, not a type - but, you know what I mean? I'd want to loop through everything in system.