2 // Mono.Data.Tds.TdsMetaParameter.cs
5 // Tim Coleman (tim@timcoleman.com)
7 // Copyright (C) Tim Coleman, 2002
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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.
32 using System.Collections;
34 namespace Mono.Data.Tds {
35 public class TdsMetaParameterCollection : ICollection, IEnumerable
43 public TdsMetaParameterCollection ()
45 list = new ArrayList ();
51 get { return list.Count; }
54 public bool IsSynchronized {
55 get { return list.IsSynchronized; }
58 public TdsMetaParameter this [int index] {
59 get { return (TdsMetaParameter) list [index]; }
62 public TdsMetaParameter this [string name] {
63 get { return (TdsMetaParameter) this [IndexOf (name)]; }
66 public object SyncRoot {
67 get { return list.SyncRoot; }
70 #endregion // Properties
74 public int Add (TdsMetaParameter value)
76 return list.Add (value);
84 public bool Contains (TdsMetaParameter value)
86 return list.Contains (value);
89 public void CopyTo (Array array, int index)
91 list.CopyTo (array, index);
94 IEnumerator IEnumerable.GetEnumerator ()
96 return list.GetEnumerator ();
99 public int IndexOf (TdsMetaParameter value)
101 return list.IndexOf (value);
104 public int IndexOf (string name)
106 for (int i = 0; i < Count; i += 1)
107 if (this [i].ParameterName.Equals (name))
112 public void Insert (int index, TdsMetaParameter value)
114 list.Insert (index, value);
117 public void Remove (TdsMetaParameter value)
122 public void Remove (string name)
124 RemoveAt (IndexOf (name));
127 public void RemoveAt (int index)
129 list.RemoveAt (index);
132 #endregion // Methods