1 // ------------------------------------------------------------------------------
2 // <copyright file="CodeCatchClauseCollection.cs" company="Microsoft">
4 // <OWNER>Microsoft</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // ------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Collections;
12 using System.Runtime.InteropServices;
17 /// A collection that stores <see cref='System.CodeDom.CodeCatchClause'/> objects.
21 ClassInterface(ClassInterfaceType.AutoDispatch),
25 public class CodeCatchClauseCollection : CollectionBase {
29 /// Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/>.
32 public CodeCatchClauseCollection() {
37 /// Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/> based on another <see cref='System.CodeDom.CodeCatchClauseCollection'/>.
40 public CodeCatchClauseCollection(CodeCatchClauseCollection value) {
46 /// Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/> containing any array of <see cref='System.CodeDom.CodeCatchClause'/> objects.
49 public CodeCatchClauseCollection(CodeCatchClause[] value) {
54 /// <para>Represents the entry at the specified index of the <see cref='System.CodeDom.CodeCatchClause'/>.</para>
56 public CodeCatchClause this[int index] {
58 return ((CodeCatchClause)(List[index]));
66 /// <para>Adds a <see cref='System.CodeDom.CodeCatchClause'/> with the specified value to the
67 /// <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para>
69 public int Add(CodeCatchClause value) {
70 return List.Add(value);
74 /// <para>Copies the elements of an array to the end of the <see cref='System.CodeDom.CodeCatchClauseCollection'/>.</para>
76 public void AddRange(CodeCatchClause[] value) {
78 throw new ArgumentNullException("value");
80 for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
87 /// Adds the contents of another <see cref='System.CodeDom.CodeCatchClauseCollection'/> to the end of the collection.
90 public void AddRange(CodeCatchClauseCollection value) {
92 throw new ArgumentNullException("value");
94 int currentCount = value.Count;
95 for (int i = 0; i < currentCount; i = ((i) + (1))) {
101 /// <para>Gets a value indicating whether the
102 /// <see cref='System.CodeDom.CodeCatchClauseCollection'/> contains the specified <see cref='System.CodeDom.CodeCatchClause'/>.</para>
104 public bool Contains(CodeCatchClause value) {
105 return List.Contains(value);
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>
112 public void CopyTo(CodeCatchClause[] array, int index) {
113 List.CopyTo(array, index);
117 /// <para>Returns the index of a <see cref='System.CodeDom.CodeCatchClause'/> in
118 /// the <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para>
120 public int IndexOf(CodeCatchClause value) {
121 return List.IndexOf(value);
125 /// <para>Inserts a <see cref='System.CodeDom.CodeCatchClause'/> into the <see cref='System.CodeDom.CodeCatchClauseCollection'/> at the specified index.</para>
127 public void Insert(int index, CodeCatchClause value) {
128 List.Insert(index, value);
132 /// <para> Removes a specific <see cref='System.CodeDom.CodeCatchClause'/> from the
133 /// <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para>
135 public void Remove(CodeCatchClause value) {