473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

List<T> and IList interface

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?
May 15 '06 #1
4 12827
KH
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() );
"Rene" wrote:
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?

May 15 '06 #2
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.
"KH" <KH@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
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() );
"Rene" wrote:
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?

May 15 '06 #3
Looks like the object browser in Visual Studio hides explicit interface
implementations. You could use Lutz Roeder's .NET Reflector instead,
see <http://www.aisto.com/roeder/dotnet/>.

May 15 '06 #4
Ah! Thanks, I thought I was going crazy!

"Johan Appelgren" <jo*************@gmail.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Looks like the object browser in Visual Studio hides explicit interface
implementations. You could use Lutz Roeder's .NET Reflector instead,
see <http://www.aisto.com/roeder/dotnet/>.

May 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Dave | last post by:
Hello all, After perusing the Standard, I believe it is true to say that once you insert an element into a std::list<>, its location in memory never changes. This makes a std::list<> ideal for...
3
by: Eric | last post by:
I have a string representation of an object. I create an object of that type through reflection. I would like to create a List<> of those objects. I obviously can't do List<myObject.GetType()>...
5
by: PJ | last post by:
I have a class definition : public class PagingList<T> : List<T> { private int pageSize, pageNumber; public PagingList() { pageSize = (this.Count == 0) ? 1 : this.Count;...
3
by: Varangian | last post by:
Hello, there I have a problem with regards to System.Collections.Generic.List<T> I need to pass a class with implements an interface - TestClass : IPerson I put this class in a...
9
by: Paul | last post by:
Hi, I feel I'm going around circles on this one and would appreciate some other points of view. From a design / encapsulation point of view, what's the best practise for returning a private...
0
by: submicron | last post by:
Hi All, I'm having problems implementing a readonly interface to a set of classes. Heres a simplification of the code: interface IreadonlyBase { // Does gets only on base class } class...
7
by: Andrew Robinson | last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v> depending on input parameters and options to the method. 1. Is there any way to convert from a dictionary to a list...
45
by: Zytan | last post by:
This returns the following error: "Cannot modify the return value of 'System.Collections.Generic.List<MyStruct>.this' because it is not a variable" and I have no idea why! Do lists return copies...
35
by: Lee Crabtree | last post by:
This seems inconsistent and more than a little bizarre. Array.Clear sets all elements of the array to their default values (0, null, whatever), whereas List<>.Clear removes all items from the...
2
by: csharpula csharp | last post by:
Hello, I would like to know what is better for data binding and serialization purposes ArrayList or List<? Thank you! *** Sent via Developersdex http://www.developersdex.com ***
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.