Hi,
IEnumerable and IEnumerator provides features for iterating the collection items but not add, remove, count etc.
So better you use ICollection which itself inherits from IEnumerable or IList (to access individual items by Index) which itself inherits from ICollection for more features.
ICollection and IList available under System.Collections.Generic for manipulating generic types and System.Collections for non-generic type.
As per your need you should go for System.Collections.ICollection for collection related add, remove, count, etc features and if you wish to access/manipulate collection items by Index then you should go for System.Collections.IList Please note that you will need to inherit IEnumerator explicitely if required because above interfaces are inheriting from IEnumerable not IEnumerator
You will find good examples in MSDN document for above interfaces, http://msdn2.microsoft.com/en-gb/library/system.collections.icollection.aspx http://msdn2.microsoft.com/en-us/library/system.collections.ilist.aspx
For more advanced collection api, you should check System.Collections namespace and find proper APIs as per your need.
HTH,
|