[Mono-winforms-list] question: CheckedListViewItemCollection and Ilist

Lluis Sanchez lluis@ximian.com
Tue, 07 Oct 2003 21:50:55 +0200


Hey Jordi!

> Some classes like CheckedListViewItemCollection have the following signature:
> 
> public class CheckedListViewItemCollection : IList, ICollection, IEnumerable {
> 
> have members like this one:
> 
> bool IList.IsReadOnly()
> 
> Do we really need to implement them? Because they are stubbed on Mono, however 
> they are declated as 'private' in the original Microsoft .Net Framework DLL 
> and they are also not in the spec.

Yes, because you need to provide an implementation for all methods of
the interfaces that the class references.

IList.IsReadOnly is an implicit interface method implementation. It
means that, although it is private, you can access to it using the
interface. So, for example:

myCollection.IsReadOnly()	// This gives a compilation error
((IList)myCollection).IsReadOnly()	// This works

Lluis.

> What should I do?
> 
> Thanks,