[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeAttributeDeclarationCollection.cs
blobe7a6baed54367539cac5bc3dc716335e6e468cc9
1 // ------------------------------------------------------------------------------
2 // <copyright file="CodeAttributeDeclarationCollection.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;
15 /// <devdoc>
16 /// <para>
17 /// A collection that stores <see cref='System.CodeDom.CodeAttributeDeclaration'/> objects.
18 /// </para>
19 /// </devdoc>
21 ClassInterface(ClassInterfaceType.AutoDispatch),
22 ComVisible(true),
23 Serializable,
25 public class CodeAttributeDeclarationCollection : CollectionBase {
27 /// <devdoc>
28 /// <para>
29 /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/>.
30 /// </para>
31 /// </devdoc>
32 public CodeAttributeDeclarationCollection() {
35 /// <devdoc>
36 /// <para>
37 /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> based on another <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/>.
38 /// </para>
39 /// </devdoc>
40 public CodeAttributeDeclarationCollection(CodeAttributeDeclarationCollection value) {
41 this.AddRange(value);
44 /// <devdoc>
45 /// <para>
46 /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> containing any array of <see cref='System.CodeDom.CodeAttributeDeclaration'/> objects.
47 /// </para>
48 /// </devdoc>
49 public CodeAttributeDeclarationCollection(CodeAttributeDeclaration[] value) {
50 this.AddRange(value);
53 /// <devdoc>
54 /// <para>Represents the entry at the specified index of the <see cref='System.CodeDom.CodeAttributeDeclaration'/>.</para>
55 /// </devdoc>
56 public CodeAttributeDeclaration this[int index] {
57 get {
58 return ((CodeAttributeDeclaration)(List[index]));
60 set {
61 List[index] = value;
65 /// <devdoc>
66 /// <para>Adds a <see cref='System.CodeDom.CodeAttributeDeclaration'/> with the specified value to the
67 /// <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> .</para>
68 /// </devdoc>
69 public int Add(CodeAttributeDeclaration value) {
70 return List.Add(value);
73 /// <devdoc>
74 /// <para>Copies the elements of an array to the end of the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/>.</para>
75 /// </devdoc>
76 public void AddRange(CodeAttributeDeclaration[] value) {
77 if (value == null) {
78 throw new ArgumentNullException("value");
80 for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
81 this.Add(value[i]);
85 /// <devdoc>
86 /// <para>
87 /// Adds the contents of another <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> to the end of the collection.
88 /// </para>
89 /// </devdoc>
90 public void AddRange(CodeAttributeDeclarationCollection value) {
91 if (value == null) {
92 throw new ArgumentNullException("value");
94 int currentCount = value.Count;
95 for (int i = 0; i < currentCount; i = ((i) + (1))) {
96 this.Add(value[i]);
100 /// <devdoc>
101 /// <para>Gets a value indicating whether the
102 /// <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> contains the specified <see cref='System.CodeDom.CodeAttributeDeclaration'/>.</para>
103 /// </devdoc>
104 public bool Contains(CodeAttributeDeclaration value) {
105 return List.Contains(value);
108 /// <devdoc>
109 /// <para>Copies the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
110 /// specified index.</para>
111 /// </devdoc>
112 public void CopyTo(CodeAttributeDeclaration[] array, int index) {
113 List.CopyTo(array, index);
116 /// <devdoc>
117 /// <para>Returns the index of a <see cref='System.CodeDom.CodeAttributeDeclaration'/> in
118 /// the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> .</para>
119 /// </devdoc>
120 public int IndexOf(CodeAttributeDeclaration value) {
121 return List.IndexOf(value);
124 /// <devdoc>
125 /// <para>Inserts a <see cref='System.CodeDom.CodeAttributeDeclaration'/> into the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> at the specified index.</para>
126 /// </devdoc>
127 public void Insert(int index, CodeAttributeDeclaration value) {
128 List.Insert(index, value);
131 /// <devdoc>
132 /// <para> Removes a specific <see cref='System.CodeDom.CodeAttributeDeclaration'/> from the
133 /// <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> .</para>
134 /// </devdoc>
135 public void Remove(CodeAttributeDeclaration value) {
136 List.Remove(value);