This repository was archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathSystem.Data.Common.DbParameterCollection.cs
More file actions
344 lines (330 loc) · 11.6 KB
/
System.Data.Common.DbParameterCollection.cs
File metadata and controls
344 lines (330 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
// CodeContracts
//
// Copyright (c) Microsoft Corporation
//
// All rights reserved.
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System.Diagnostics.Contracts;
namespace System.Data.Common
{
// Summary:
// The base class for a collection of parameters relevant to a System.Data.Common.DbCommand.
[ContractClass(typeof(DbParameterCollectionContract))]
public abstract class DbParameterCollection //: MarshalByRefObject, IDataParameterCollection, IList, ICollection, IEnumerable
{
// Summary:
// Initializes a new instance of the System.Data.Common.DbParameterCollection
// class.
//protected DbParameterCollection();
// Summary:
// Specifies the number of items in the collection.
//
// Returns:
// The number of items in the collection.
//rowsable(false)]
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public abstract int Count { get; }
//
// Summary:
// Specifies whether the collection is a fixed size.
//
// Returns:
// true if the collection is a fixed size; otherwise false.
//[EditorBrowsable(EditorBrowsableState.Never)]
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
//rowsable(false)]
//public abstract bool IsFixedSize { get; }
//
// Summary:
// Specifies whether the collection is read-only.
//
// Returns:
// true if the collection is read-only; otherwise false.
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
//[EditorBrowsable(EditorBrowsableState.Never)]
//rowsable(false)]
//public abstract bool IsReadOnly { get; }
//
// Summary:
// Specifies whether the collection is synchronized.
//
// Returns:
// true if the collection is synchronized; otherwise false.
//rowsable(false)]
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
//[EditorBrowsable(EditorBrowsableState.Never)]
//public abstract bool IsSynchronized { get; }
//
// Summary:
// Specifies the System.Object to be used to synchronize access to the collection.
//
// Returns:
// A System.Object to be used to synchronize access to the System.Data.Common.DbParameterCollection.
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
//[EditorBrowsable(EditorBrowsableState.Never)]
//rowsable(false)]
//public abstract object SyncRoot { get; }
// Summary:
// Gets and sets the System.Data.Common.DbParameter at the specified index.
//
// Parameters:
// index:
// The zero-based index of the parameter.
//
// Returns:
// The System.Data.Common.DbParameter at the specified index.
//
// Exceptions:
// System.IndexOutOfRangeException:
// The specified index does not exist.
public DbParameter this[int index]
{
get
{
Contract.Requires(index >= 0);
return default(DbParameter);
}
set
{
Contract.Requires(index >= 0);
}
}
//
// Summary:
// Gets and sets the System.Data.Common.DbParameter with the specified name.
//
// Parameters:
// parameterName:
// The name of the parameter.
//
// Returns:
// The System.Data.Common.DbParameter with the specified name.
//
// Exceptions:
// System.IndexOutOfRangeException:
// The specified index does not exist.
public DbParameter this[string parameterName]
{
get
{
return default(DbParameter);
}
set
{
}
}
// Summary:
// Adds a System.Data.Common.DbParameter item with the specified value to the
// System.Data.Common.DbParameterCollection.
//
// Parameters:
// value:
// The System.Data.Common.DbParameter.Value of the System.Data.Common.DbParameter
// to add to the collection.
//
// Returns:
// The index of the System.Data.Common.DbParameter object in the collection.
public abstract int Add(object value);
//
// Summary:
// Adds an array of items with the specified values to the System.Data.Common.DbParameterCollection.
//
// Parameters:
// values:
// An array of values of type System.Data.Common.DbParameter to add to the collection.
public abstract void AddRange(Array values);
//
// Summary:
// Removes all System.Data.Common.DbParameter values from the System.Data.Common.DbParameterCollection.
//public abstract void Clear();
//
// Summary:
// Indicates whether a System.Data.Common.DbParameter with the specified System.Data.Common.DbParameter.Value
// is contained in the collection.
//
// Parameters:
// value:
// The System.Data.Common.DbParameter.Value of the System.Data.Common.DbParameter
// to look for in the collection.
//
// Returns:
// true if the System.Data.Common.DbParameter is in the collection; otherwise
// false.
//public abstract bool Contains(object value);
//
// Summary:
// Indicates whether a System.Data.Common.DbParameter with the specified name
// exists in the collection.
//
// Parameters:
// value:
// The name of the System.Data.Common.DbParameter to look for in the collection.
//
// Returns:
// true if the System.Data.Common.DbParameter is in the collection; otherwise
// false.
//public abstract bool Contains(string value);
//
// Summary:
// Copies an array of items to the collection starting at the specified index.
//
// Parameters:
// array:
// The array of items to copy to the collection.
//
// index:
// The index in the collection to copy the items.
//public abstract void CopyTo(Array array, int index);
//
// Summary:
// Exposes the System.Collections.IEnumerable.GetEnumerator() method, which
// supports a simple iteration over a collection by a .NET Framework data provider.
//
// Returns:
// An System.Collections.IEnumerator that can be used to iterate through the
// collection.
//[EditorBrowsable(EditorBrowsableState.Never)]
//public abstract IEnumerator GetEnumerator();
//
// Summary:
// Returns the System.Data.Common.DbParameter object at the specified index
// in the collection.
//
// Parameters:
// index:
// The index of the System.Data.Common.DbParameter in the collection.
//
// Returns:
// The System.Data.Common.DbParameter object at the specified index in the collection.
//protected abstract DbParameter GetParameter(int index);
//
// Summary:
// Returns System.Data.Common.DbParameter the object with the specified name.
//
// Parameters:
// parameterName:
// The name of the System.Data.Common.DbParameter in the collection.
//
// Returns:
// The System.Data.Common.DbParameter the object with the specified name.
//protected abstract DbParameter GetParameter(string parameterName);
//
// Summary:
// Returns the index of the specified System.Data.Common.DbParameter object.
//
// Parameters:
// value:
// The System.Data.Common.DbParameter object in the collection.
//
// Returns:
// The index of the specified System.Data.Common.DbParameter object.
//public abstract int IndexOf(object value);
////
// Summary:
// Returns the index of the System.Data.Common.DbParameter object with the specified
// name.
//
// Parameters:
// parameterName:
// The name of the System.Data.Common.DbParameter object in the collection.
//
// Returns:
// The index of the System.Data.Common.DbParameter object with the specified
// name.
//public abstract int IndexOf(string parameterName);
//
// Summary:
// Inserts the specified index of the System.Data.Common.DbParameter object
// with the specified name into the collection at the specified index.
//
// Parameters:
// index:
// The index at which to insert the System.Data.Common.DbParameter object.
//
// value:
// The System.Data.Common.DbParameter object to insert into the collection.
//public abstract void Insert(int index, object value);
//
// Summary:
// Removes the specified System.Data.Common.DbParameter object from the collection.
//
// Parameters:
// value:
// The System.Data.Common.DbParameter object to remove.
//public abstract void Remove(object value);
//
// Summary:
// Removes the System.Data.Common.DbParameter object at the specified from the
// collection.
//
// Parameters:
// index:
// The index where the System.Data.Common.DbParameter object is located.
//public abstract void RemoveAt(int index);
//
// Summary:
// Removes the System.Data.Common.DbParameter object with the specified name
// from the collection.
//
// Parameters:
// parameterName:
// The name of the System.Data.Common.DbParameter object to remove.
//public abstract void RemoveAt(string parameterName);
//
// Summary:
// Sets the System.Data.Common.DbParameter object at the specified index to
// a new value.
//
// Parameters:
// index:
// The index where the System.Data.Common.DbParameter object is located.
//
// value:
// The new System.Data.Common.DbParameter value.
//protected abstract void SetParameter(int index, DbParameter value);
//
// Summary:
// Sets the System.Data.Common.DbParameter object with the specified name to
// a new value.
//
// Parameters:
// parameterName:
// The name of the System.Data.Common.DbParameter object in the collection.
//
// value:
// The new System.Data.Common.DbParameter value.
//protected abstract void SetParameter(string parameterName, DbParameter value);
}
[ContractClassFor(typeof(DbParameterCollection))]
abstract class DbParameterCollectionContract : DbParameterCollection
{
private DbParameterCollectionContract()
{
}
public override int Add(object value)
{
Contract.Requires(value != null);
Contract.Ensures(Contract.Result<int>() >= 0);
return default(int);
}
public override void AddRange(Array values)
{
Contract.Requires(values != null);
}
public override int Count
{
get
{
Contract.Ensures(Contract.Result<int>() >= 0);
return default(int);
}
}
}
}