1 // ------------------------------------------------------------------------------
2 // <copyright file="CodeAttributeDeclarationCollection.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.CodeAttributeDeclaration'/> objects.
21 ClassInterface(ClassInterfaceType
.AutoDispatch
),
25 public class CodeAttributeDeclarationCollection
: CollectionBase
{
29 /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/>.
32 public CodeAttributeDeclarationCollection() {
37 /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> based on another <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/>.
40 public CodeAttributeDeclarationCollection(CodeAttributeDeclarationCollection
value) {
46 /// Initializes a new instance of <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> containing any array of <see cref='System.CodeDom.CodeAttributeDeclaration'/> objects.
49 public CodeAttributeDeclarationCollection(CodeAttributeDeclaration
[] value) {
54 /// <para>Represents the entry at the specified index of the <see cref='System.CodeDom.CodeAttributeDeclaration'/>.</para>
56 public CodeAttributeDeclaration
this[int index
] {
58 return ((CodeAttributeDeclaration
)(List
[index
]));
66 /// <para>Adds a <see cref='System.CodeDom.CodeAttributeDeclaration'/> with the specified value to the
67 /// <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> .</para>
69 public int Add(CodeAttributeDeclaration
value) {
70 return List
.Add(value);
74 /// <para>Copies the elements of an array to the end of the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/>.</para>
76 public void AddRange(CodeAttributeDeclaration
[] 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.CodeAttributeDeclarationCollection'/> to the end of the collection.
90 public void AddRange(CodeAttributeDeclarationCollection
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.CodeAttributeDeclarationCollection'/> contains the specified <see cref='System.CodeDom.CodeAttributeDeclaration'/>.</para>
104 public bool Contains(CodeAttributeDeclaration
value) {
105 return List
.Contains(value);
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>
112 public void CopyTo(CodeAttributeDeclaration
[] array
, int index
) {
113 List
.CopyTo(array
, index
);
117 /// <para>Returns the index of a <see cref='System.CodeDom.CodeAttributeDeclaration'/> in
118 /// the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> .</para>
120 public int IndexOf(CodeAttributeDeclaration
value) {
121 return List
.IndexOf(value);
125 /// <para>Inserts a <see cref='System.CodeDom.CodeAttributeDeclaration'/> into the <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> at the specified index.</para>
127 public void Insert(int index
, CodeAttributeDeclaration
value) {
128 List
.Insert(index
, value);
132 /// <para> Removes a specific <see cref='System.CodeDom.CodeAttributeDeclaration'/> from the
133 /// <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> .</para>
135 public void Remove(CodeAttributeDeclaration
value) {