문제

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

도움이 되었습니까?

해결책

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(...);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top