[genmdesc] Fixed generator to allow instructions lengths equal to 0.
[mono.git] / mcs / class / System.Data / System.Data.OleDb.jvm / OleDbParameterCollection.cs
1 //
2 // System.Data.Common.OleDbParameterCollection
3 //
4 // Authors:
5 //      Konstantin Triger <kostat@mainsoft.com>
6 //      Boris Kirzner <borisk@mainsoft.com>
7 //      
8 // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
9 //
10
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
19 // 
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
22 // 
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 //
31
32
33 using System.Data.ProviderBase;
34
35 namespace System.Data.OleDb
36 {
37     public sealed class OleDbParameterCollection :  AbstractDbParameterCollection
38     {
39                 #region Constructors
40
41         public OleDbParameterCollection(OleDbCommand parent): base(parent)
42         {
43         }
44
45                 #endregion // Constructors
46
47                 #region Properties
48         
49         public OleDbParameter this[int index]
50         {
51             get { return (OleDbParameter)base[index]; }
52             set { 
53                                 OnSchemaChanging();
54                                 base[index] = value; 
55                         }
56         }
57
58         public OleDbParameter this[string parameterName]
59         {
60             get { return (OleDbParameter)base[parameterName]; }
61             set { 
62                                 OnSchemaChanging();
63                                 base[parameterName] = value; 
64                         }
65         }
66
67                 protected override Type ItemType { 
68                         get { return typeof(OleDbParameter); }
69                 }
70
71                 #endregion // Properties
72
73                 #region Methods
74
75         public OleDbParameter Add(OleDbParameter value)
76         {
77             base.Add(value);
78             return value;
79         }
80
81         public OleDbParameter Add(string parameterName, object value)
82         {
83             OleDbParameter param = new OleDbParameter(parameterName, value);
84             return Add(param);
85         }
86
87         public OleDbParameter Add(string parameterName, OleDbType sqlDbType)
88         {
89             OleDbParameter param = new OleDbParameter(parameterName, sqlDbType);
90             return Add(param);
91         }
92
93         public OleDbParameter Add(string parameterName, OleDbType sqlDbType, int size)
94         {
95             OleDbParameter param = new OleDbParameter(parameterName, sqlDbType, size);
96             return Add(param);
97         }
98
99         public OleDbParameter Add(string parameterName, OleDbType sqlDbType, int size, string sourceColumn)
100         {
101             OleDbParameter param = new OleDbParameter(parameterName, sqlDbType, size, sourceColumn);
102             return Add(param);
103                 }
104
105                 public void AddRange (OleDbParameter [] values)
106                 {
107                         base.AddRange (values);
108                 }
109
110                 public OleDbParameter AddWithValue (string parameterName, object value)
111                 {
112                         return Add (parameterName, value);
113                 }
114
115                 public bool Contains (OleDbParameter value)
116                 {
117                         return base.Contains (value);
118                 }
119
120                 public void CopyTo (OleDbParameter [] array, int index)
121                 {
122                         base.CopyTo (array, index);
123                 }
124
125                 public void Insert (int index, OleDbParameter value)
126                 {
127                         base.Insert (index, value);
128                 }
129
130                 public void Remove (OleDbParameter value)
131                 {
132                         base.Remove (value);
133                 }
134
135                 public int IndexOf (OleDbParameter value)
136                 {
137                         return base.IndexOf (value);
138                 }
139
140                 #endregion // Methods        
141         
142     }
143 }