| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //
- // System.Data.OleDb.OleDbErrorCollection
- //
- // Authors:
- // Rodrigo Moya ([email protected])
- // Tim Coleman ([email protected])
- //
- // Copyright (C) Rodrigo Moya, 2002
- // Copyright (C) Tim Coleman, 2002
- //
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Data.Common;
- namespace System.Data.OleDb
- {
- [ListBindableAttribute ( false)]
- public sealed class OleDbErrorCollection : ICollection, IEnumerable
- {
- #region Fields
- ArrayList list;
-
- #endregion // Fields
- #region Properties
- public int Count {
- get {
- return list.Count;
- }
- }
- public OleDbError this[int index] {
- get {
- return (OleDbError) list[index];
- }
- }
- object ICollection.SyncRoot {
- get {
- return list.SyncRoot;
- }
- }
- bool ICollection.IsSynchronized {
- get {
- return list.IsSynchronized;
- }
- }
- #endregion // Properties
- #region Methods
- internal void Add (OleDbError error)
- {
- list.Add ((object) error);
- }
-
- public void CopyTo (Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException("array");
-
- if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound (0)))
- throw new ArgumentOutOfRangeException("index");
-
- // is the check for IsFixedSize required?
- if ((array.IsFixedSize) || (index + this.Count > array.GetUpperBound (0)))
- throw new ArgumentException("array");
-
- ((OleDbError[])(list.ToArray ())).CopyTo (array, index);
-
- }
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
- #endregion // Methods
- }
- }
|