Mikatsu
Mikatsu

Reputation: 550

CollectionBase no IList implementation?

Would anyone explain to me why in the abstract CollectionBase class (in System.Collections which derives from IList) it does not have the IList members implemented? I thought it was obligatory.

System.Collection.CollectionBase

Upvotes: 0

Views: 671

Answers (1)

Lee
Lee

Reputation: 144206

It implements IList explicitly, so you'll need to cast your CollectionBase instance to IList to access those members.

IList list = (IList)collectionBase;
list.Add(...);

Upvotes: 2

Related Questions