Click here to Skip to main content
11,703,631 members (67,157 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# collections
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 at 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
0 Maciej Los 570
1 OriginalGriff 500
2 Sergey Alexandrovich Kryukov 410
3 F-ES Sitecore 165
4 Andy Lanng 159
0 OriginalGriff 8,519
1 Sergey Alexandrovich Kryukov 7,667
2 CPallini 4,987
3 Maciej Los 4,686
4 Mika Wendelius 3,566

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2015
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