
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Reversing the Contents of a Sorted List
|
259
DictionaryEntry IDictionaryEnumerator.Entry
{
get
{
if ((this.index == 0) ||
(this.index == (this._ReversibleSortedList.Count + 1)))
{
throw new InvalidOperationException(
"Enumeration operation cannot happen.");
}
return new DictionaryEntry(this.key, this.value);
}
}
public KeyValuePair<K, V> Current
{
get
{
return new KeyValuePair<K, V>(this.key, this.value);
}
}
object IEnumerator.Current
{
get
{
if ((this.index == 0) ||
(this.index == (this._ReversibleSortedList.Count + 1)))
{
throw new InvalidOperationException(
"Enumeration operation cannot occur");
}
return new DictionaryEntry(this.key, this.value);
}
}
object IDictionaryEnumerator.Value
{
get
{
if ((this.index == 0) ||
(this.index == (this._ReversibleSortedList.Count + 1)))
{
throw new InvalidOperationException(
"Enumeration operation cannot occur");
}
return this.value;
}
}
void IEnumerator.Reset( )
{
if (this.version != this._ReversibleSortedList.version)
{
throw new InvalidOperationException(
"Enumeration version check failed");
Example 4-3. ReversibleSortedList class (continued)