Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeCatchClauseCollection.cs
1 // ------------------------------------------------------------------------------
2 // <copyright file="CodeCatchClauseCollection.cs" company="Microsoft">
3 // 
4 // <OWNER>Microsoft</OWNER>
5 //     Copyright (c) Microsoft Corporation.  All rights reserved.
6 // </copyright> 
7 // ------------------------------------------------------------------------------
8 // 
9 namespace System.CodeDom {
10     using System;
11     using System.Collections;
12     using System.Runtime.InteropServices;
13     
14     
15     /// <devdoc>
16     ///     <para>
17     ///       A collection that stores <see cref='System.CodeDom.CodeCatchClause'/> objects.
18     ///    </para>
19     /// </devdoc>
20     [
21         ClassInterface(ClassInterfaceType.AutoDispatch),
22         ComVisible(true),
23         Serializable,
24     ]
25     public class CodeCatchClauseCollection : CollectionBase {
26         
27         /// <devdoc>
28         ///     <para>
29         ///       Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/>.
30         ///    </para>
31         /// </devdoc>
32         public CodeCatchClauseCollection() {
33         }
34         
35         /// <devdoc>
36         ///     <para>
37         ///       Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/> based on another <see cref='System.CodeDom.CodeCatchClauseCollection'/>.
38         ///    </para>
39         /// </devdoc>
40         public CodeCatchClauseCollection(CodeCatchClauseCollection value) {
41             this.AddRange(value);
42         }
43         
44         /// <devdoc>
45         ///     <para>
46         ///       Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/> containing any array of <see cref='System.CodeDom.CodeCatchClause'/> objects.
47         ///    </para>
48         /// </devdoc>
49         public CodeCatchClauseCollection(CodeCatchClause[] value) {
50             this.AddRange(value);
51         }
52         
53         /// <devdoc>
54         /// <para>Represents the entry at the specified index of the <see cref='System.CodeDom.CodeCatchClause'/>.</para>
55         /// </devdoc>
56         public CodeCatchClause this[int index] {
57             get {
58                 return ((CodeCatchClause)(List[index]));
59             }
60             set {
61                 List[index] = value;
62             }
63         }
64         
65         /// <devdoc>
66         ///    <para>Adds a <see cref='System.CodeDom.CodeCatchClause'/> with the specified value to the 
67         ///    <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para>
68         /// </devdoc>
69         public int Add(CodeCatchClause value) {
70             return List.Add(value);
71         }
72         
73         /// <devdoc>
74         /// <para>Copies the elements of an array to the end of the <see cref='System.CodeDom.CodeCatchClauseCollection'/>.</para>
75         /// </devdoc>
76         public void AddRange(CodeCatchClause[] value) {
77             if (value == null) {
78                 throw new ArgumentNullException("value");
79             }
80             for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
81                 this.Add(value[i]);
82             }
83         }
84         
85         /// <devdoc>
86         ///     <para>
87         ///       Adds the contents of another <see cref='System.CodeDom.CodeCatchClauseCollection'/> to the end of the collection.
88         ///    </para>
89         /// </devdoc>
90         public void AddRange(CodeCatchClauseCollection value) {
91             if (value == null) {
92                 throw new ArgumentNullException("value");
93             }
94             int currentCount = value.Count;
95             for (int i = 0; i < currentCount; i = ((i) + (1))) {
96                 this.Add(value[i]);
97             }
98         }
99         
100         /// <devdoc>
101         /// <para>Gets a value indicating whether the 
102         ///    <see cref='System.CodeDom.CodeCatchClauseCollection'/> contains the specified <see cref='System.CodeDom.CodeCatchClause'/>.</para>
103         /// </devdoc>
104         public bool Contains(CodeCatchClause value) {
105             return List.Contains(value);
106         }
107         
108         /// <devdoc>
109         /// <para>Copies the <see cref='System.CodeDom.CodeCatchClauseCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 
110         ///    specified index.</para>
111         /// </devdoc>
112         public void CopyTo(CodeCatchClause[] array, int index) {
113             List.CopyTo(array, index);
114         }
115         
116         /// <devdoc>
117         ///    <para>Returns the index of a <see cref='System.CodeDom.CodeCatchClause'/> in 
118         ///       the <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para>
119         /// </devdoc>
120         public int IndexOf(CodeCatchClause value) {
121             return List.IndexOf(value);
122         }
123         
124         /// <devdoc>
125         /// <para>Inserts a <see cref='System.CodeDom.CodeCatchClause'/> into the <see cref='System.CodeDom.CodeCatchClauseCollection'/> at the specified index.</para>
126         /// </devdoc>
127         public void Insert(int index, CodeCatchClause value) {
128             List.Insert(index, value);
129         }
130         
131         /// <devdoc>
132         ///    <para> Removes a specific <see cref='System.CodeDom.CodeCatchClause'/> from the 
133         ///    <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para>
134         /// </devdoc>
135         public void Remove(CodeCatchClause value) {
136             List.Remove(value);
137         }
138     }
139 }