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