List<T> and IList interface

R

Rene

According to the documentation, the List<T> type explicitly implements the
non generic IList interface.

The problem is that no matter how hard I look, I am not able to find this
implemetion on the List<T> type. Could some one tell me where can I find the
IList implementation?

Please note that the plase where I am looking for this implementation is
from the Visula Studio metadata information page. The page that shows up
when you right-click on the "List<T>" word and then click on the "Go To
Definition" menu item.

This has to be something very stupid of my part, what am I missing?
 
G

Guest

The IList members are implemented explicitly ("explicit interface
implementations" in msdn) -- so they will only be available when treating the
List<T> as a non-generic IList:

// disclaimer: untested code

System.Collections.IList list = new System.Collections.Generic.List<T>();
list.Add( new Object() );
 
R

Rene

I already knew that, my question was: Where is that implementation on the
List<T> metadata? I don't see it. I should be able to see the explicit
implementation such as:

int IList.Add(object value);

take a second to re-read my original post a little more carefully and you
will see what I mean.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top