2007-07-22 Nagappan A <anagappan@novell.com>
[mono.git] / mcs / class / Mono.Data.Tds / Mono.Data.Tds.Protocol / TdsDataRow.cs
1 //
2 // Mono.Data.Tds.Protocol.TdsDataRow.cs
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2002
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.Collections;
33
34 namespace Mono.Data.Tds.Protocol {
35         public class TdsDataRow : IList, ICollection, IEnumerable
36         {
37                 #region Fields
38
39                 ArrayList list;
40                 int bigDecimalIndex;
41
42                 #endregion // Fields
43
44                 #region Constructors
45
46                 public TdsDataRow ()
47                 {
48                         list = new ArrayList ();
49                         bigDecimalIndex = -1;
50                 }
51
52                 #endregion // Constructors
53
54                 #region Properties
55
56                 public int BigDecimalIndex {
57                         get { return bigDecimalIndex; }
58                         set { bigDecimalIndex = value; }
59                 }
60
61                 public int Count {
62                         get { return list.Count; }
63                 }
64
65                 public bool IsFixedSize {
66                         get { return false; }
67                 }
68
69                 public bool IsReadOnly {
70                         get { return false; }
71                 }
72         
73                 public bool IsSynchronized {
74                         get { return list.IsSynchronized; }
75                 }
76
77                 public object SyncRoot {
78                         get { return list.SyncRoot; }
79                 }
80
81                 public object this[int index] {
82                         get { 
83                                 if (index >= list.Count)
84                                         throw new IndexOutOfRangeException ();
85                                 return list[index]; 
86                         }
87                         set { list[index] = value; }
88                 }
89
90                 #endregion // Properties
91
92                 #region Methods 
93
94                 public int Add (object value)
95                 {
96                         return list.Add (value);
97                 }
98
99                 public void Clear ()
100                 {
101                         list.Clear ();
102                 }
103
104                 public bool Contains (object value)
105                 {
106                         return list.Contains (value);
107                 }
108
109                 public void CopyTo (Array array, int index)
110                 {
111                         list.CopyTo (array, index);
112                 }
113
114                 public void CopyTo (int index, Array array, int arrayIndex, int count)
115                 {
116                         list.CopyTo (index, array, arrayIndex, count);
117                 }
118
119                 public IEnumerator GetEnumerator ()
120                 {
121                         return list.GetEnumerator ();
122                 }
123
124                 public int IndexOf (object value)
125                 {
126                         return list.IndexOf (value);
127                 }
128
129                 public void Insert (int index, object value)
130                 {
131                         list.Insert (index, value);
132                 }
133
134                 public void Remove (object value)
135                 {
136                         list.Remove (value);
137                 }
138
139                 public void RemoveAt (int index)
140                 {
141                         list.RemoveAt (index);
142                 }
143
144                 #endregion // Methods
145         }
146 }