Click here to Skip to main content
13,148,573 members (56,608 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Is there any way, we could view complete definition for CollectionBase class in System.Collection namespace ? Even in msdn, I couldn't find the method definitions in CollectionBase class. Although, the web pages in msdn contains only the properties and method declarations, the definitions are not provided : msdn link.

My doubt was :-
CollectionBase class implements IList, ICollection and IEnumerable interfaces. To derive our own collections, we can use List, which gives us access to the items through an IList interface, and InnerList, which is the ArrayList object is used to store items. There is no trace of Add method in CollectionBase class, so how does List.Add(item) work ? Where has Add method been defined ? Add method can't be defined in interfaces and there is no trace of Add method in CollectionBase class..
Posted 6-Dec-12 6:05am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Um. I found it pretty easily:[^]

And it lists the Add method under "Explicit Interface Implementations"

How did I find it?
I Googled for CollectionBase class[^] by highlighting it in your question and right clicking. Select "Search Google for..." and it was the top hit.

Perhaps your Google-fu needs a little improvement?
arunlakra15 6-Dec-12 12:25pm
ah perhaps.. I'm new to this. So there must be an implementation for IList.Add method in CollectionBase class, right ? And If there is, can we view how it has been implemented ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170924.2 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100