style and ^Ms in last patch from Alon
[mono.git] / mcs / class / System.Web / System.Web.UI / KeyedListEnumerator.cs
1 //
2 // System.Web.UI/KeyedListEnumerator.cs
3 //
4 // Author: Todd Berman <tberman@gentoo.org>
5 //
6 // (C) 2003 Todd Berman
7
8 #if NET_2_0
9
10 using System.Collections;
11
12 namespace System.Web.UI
13 {
14         public class KeyedListEnumerator : IDictionaryEnumerator
15         {
16                 private int index = -1;
17                 private ArrayList objs;
18
19                 internal KeyedListEnumerator (ArrayList list)
20                 {
21                         objs = list;
22                 }
23
24                 public bool MoveNext ()
25                 {
26                         index++;
27                         if (index >= objs.Count)
28                                 return false;
29
30                         return true;
31                 }
32
33                 public void Reset ()
34                 {
35                         index = -1;
36                 }
37
38                 public object Current {
39                         get {
40                                 if (index < 0 || index >= objs.Count)
41                                         throw new InvalidOperationException ();
42
43                                 return objs[index];
44                         }
45                 }
46
47                 public DictionaryEntry Entry {
48                         get {
49                                 return (DictionaryEntry) Current;
50                         }
51                 }
52
53                 public object Key {
54                         get {
55                                 return Entry.Key;
56                         }
57                 }
58
59                 public object Value {
60                         get {
61                                 return Entry.Value;
62                         }
63                 }
64         }
65 }
66
67 #endif