Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data / System / Data / SqlClient / SqlErrorCollection.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="SqlErrorCollection.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 //------------------------------------------------------------------------------
8
9 namespace System.Data.SqlClient {
10
11     using System;
12     using System.Collections;
13     using System.ComponentModel;
14     using System.Diagnostics;
15     using System.Runtime.InteropServices;
16
17     [Serializable, ListBindable(false)]
18     public sealed class SqlErrorCollection : ICollection {
19
20         private ArrayList errors = new ArrayList();
21
22         internal SqlErrorCollection() {
23         }
24
25         public void CopyTo (Array array, int index) {
26             this.errors.CopyTo(array, index);
27         }
28
29         public void CopyTo (SqlError[] array, int index) {
30             this.errors.CopyTo(array, index);
31         }
32
33         public int Count {
34             get { return this.errors.Count;}
35         }
36
37         object System.Collections.ICollection.SyncRoot { // MDAC 68481
38             get { return this;}
39         }
40
41         bool System.Collections.ICollection.IsSynchronized { // MDAC 68481
42             get { return false;}
43         }
44
45         public SqlError this[int index] {
46             get {
47                 return (SqlError) this.errors[index];
48             }
49         }
50
51         public IEnumerator GetEnumerator() {
52             return errors.GetEnumerator();
53         }
54
55         internal void Add(SqlError error) {
56             this.errors.Add(error);
57         }
58     }
59 }