| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- //
- // System.Data.SqlClient.SqlErrorCollection.cs
- //
- // Author:
- // Rodrigo Moya ([email protected])
- // Daniel Morgan ([email protected])
- // Tim Coleman ([email protected])
- //
- // (C) Ximian, Inc 2002
- // Copyright (C) Tim Coleman, 2002
- //
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Runtime.InteropServices;
- namespace System.Data.SqlClient {
- [ListBindable (false)]
- [Serializable]
- public sealed class SqlErrorCollection : ICollection, IEnumerable
- {
- #region Fields
- ArrayList list = new ArrayList();
- #endregion // Fields
- #region Constructors
- internal SqlErrorCollection ()
- {
- }
- internal SqlErrorCollection (byte theClass, int lineNumber, string message, int number, string procedure, string server, string source, byte state)
- {
- Add (theClass, lineNumber, message, number, procedure, server, source, state);
- }
- #endregion // Constructors
- #region Properties
-
- public int Count {
- get { return list.Count; }
- }
- bool ICollection.IsSynchronized {
- get { return list.IsSynchronized; }
- }
- object ICollection.SyncRoot {
- get { return list.SyncRoot; }
- }
- public SqlError this[int index] {
- get { return (SqlError) list [index]; }
- }
- #endregion
- #region Methods
-
- internal void Add(SqlError error)
- {
- list.Add (error);
- }
- internal void Add(byte theClass, int lineNumber, string message, int number, string procedure, string server, string source, byte state)
- {
- SqlError error = new SqlError (theClass, lineNumber, message, number, procedure, server, source, state);
- Add (error);
- }
- public void CopyTo (Array array, int index)
- {
- list.CopyTo (array, index);
- }
- public IEnumerator GetEnumerator()
- {
- return list.GetEnumerator ();
- }
- #endregion
- }
- }
|