March 2004
Intermediate to advanced
560 pages
26h 47m
English
public interface IEnumerator { // Properties object Current { get; } // Methods bool MoveNext (); void Reset (); }
|
BA During the design of the BCL we debated long and hard about including the Reset method on this interface. On one side, we knew of several kinds of enumerators for which implementing Reset would be impractical. On the other side, we felt it was very important to provide some compatibility with COM's IEnum interface. So we compromised and included Reset, but took the unusual step of allowing implementers to throw a NotSupportedException if implementing Reset is not appropriate. Usually, having to throw a NotSupportedException from an interface implementation either means that the interface is not well designed, or ... |
Read now
Unlock full access