• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Consulting the .NET SDK

nordloewelabs

Senior member
i was instantiating a Generic List object today and learnt -- from the intellisense -- that the class' constructor has an overload that takes a Generic IEnumerable as argument. that is nice infor, but it could be more useful if i knew all classes that implement the aformentioned interface.

after some googling, i found out that Array class does implement the Generic IEnumerable interface. however, i'm still wondering if there's a way i could have found that out through the SDK or intellisense....
 
Well, the MSDN docs usually list all the standard derived classes for a given interface, but other than that you'd have to be reflecting the assembly the derived class is implemented in. As far as I know there is no comprehensive way to gather that info.
 
Well, the MSDN docs usually list all the standard derived classes for a given interface

do they? where is it listed? i can see all the interfaces implemented by a given class, but not the other way round?

somewhere else someone recommened reflection as well... i dont even know what it is, so i'll assume Microsoft expects everyone to memorize all implementers for all interfaces....
 
Originally posted by: nordloewelabs
Well, the MSDN docs usually list all the standard derived classes for a given interface

do they? where is it listed? i can see all the interfaces implemented by a given class, but not the other way round?

somewhere else someone recommened reflection as well... i dont even know what it is, so i'll assume Microsoft expects everyone to memorize all implementers for all interfaces....

Usually it's at the very bottom of the page for a given base class.
 
not sure if i understood you right, but i just checked the page for the IEnumerable class and there's no list of implementers on the bottom of the page. maybe this applies to some interfaces but not all.
 
I don't think you can get a list of implementers. We have hundreds of libraries throughout our company that have implemented IList<>. How is Microsoft supposed to track that info? Even for their own internal libraries, how is the .NET team going to know what the SQL Server team with the base class library?

I am not trying to discount your thought... I am just stating the obvious - I don't think there is a "master" list of implementers of interfaces for .NET (or for Java).
 
Originally posted by: clamum
Are you looking for something like this?

yes. something kind like that! nice find, mate! i wanted that kind of info on the "Generic IEnumerable" of .NET 2.0, though. maybe the number of inheritances grew to a point that made unfeasible for MS to keep making such table....
 
Dim types As New List(Of Type)

Dim xDLL As System.Reflection.Assembly
xDLL = Reflection.Assembly.Load("mscorlib")

Dim Thing As IEnumerable
Dim IE As Type = GetType(IEnumerable)



For Each t As Type In xDLL.GetExportedTypes
For Each subType As Type In t.GetInterfaces
If subType Is IE Then
types.Add(t)
Exit For
End If
Next
Next
For Each t As Type In types
MsgBox(t.Name)
Next
 
As far as framework classes, IEnumerable<T> is implemented by all generic collection classes. I think IQueryable (LINQ) even inherits from it.
 
Back
Top