[Mono-list] Missing Interfaces in corlib

Nick Drochak ndrochak@gol.com
Thu, 17 Jan 2002 01:16:50 +0900


This problem intrigued me just a bit, so I came up with a very simple
tool that seems to do the job.  It's in mcs/tools called IFaceDisco.
Just give it an interface and it will tell you the types that implement
it directly.

I spot checked the output on several interfaces with the MSDN docs, and
it seems to be the same.  Let me know if you have any problems or

Nick D.

> -----Original Message-----
> From: mono-list-admin@ximian.com 
> [mailto:mono-list-admin@ximian.com] On Behalf Of Derek Holden
> Sent: Tuesday, January 15, 2002 12:26 AM
> To: Nick Drochak
> Cc: 'Mono List'
> Subject: RE: [Mono-list] Missing Interfaces in corlib
> Hmm, not the most optimal solution. In discussing the 
> IConvertible stuff I 
> was hoping to find all classes that implement it directly. I 
> say add it if 
> you don't mind, it may help me in some of the formatting stuff also.
> At 1/14/2002 10:05 AM, Nick Drochak wrote:
> > > Would it be easy to modify your tool that did this so 
> that given a 
> > > particular Interface, it could generate a complete list 
> of classes 
> > > in mscorlib that implements that interface? I only see  
> corcompare 
> > > in mcs/tools, so I apologize for asking if it's included 
> somewhere.
> > >
> >
> >Probably would be better to have a separate tool for this for now.
> >
> >I tried to make it, but found out that when you call 
> GetInterfaces() on 
> >a type, it runtime walks the whole hierarchy and returns any and all 
> >interfaces implemented all the way up to System.Object.
> >
> >So it depends on what you want to know.  The MSDN docs show 
> the classes 
> >that directly implement a particular interface, but the tool I wrote 
> >real quick will tell you all the types that implement the iface 
> >directly or through one of their ancestors; e.g. my tool says that 
> >System.AppDomainUnloadedException implements Iserializable.  It does 
> >through it's ancestor, Exception.
> >
> >If that's what you need (or would be useful to anyone else) 
> I can add 
> >it to the tools directory.  It's *very* simple.
> >
> >Regards,
> >Nick D.
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-> list