Pregunta

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

¿Fue útil?

Solución

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(...);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top