Files
mono/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs
T
Umadevi S 3dd5e6fe1a 2004-03-23 Umadevi S ([email protected])
* implemented Attributes, methods in OleDbError.cs & OleDbErrorCollection.cs

svn path=/trunk/mcs/; revision=24453
2004-03-23 10:41:16 +00:00

94 lines
2.2 KiB
C#

//
// 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
}
}