1 // ------------------------------------------------------------------------------
2 // <copyright file="CodeTypeReferenceCollection.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.CodeTypeReference'/> objects.
21 ClassInterface(ClassInterfaceType.AutoDispatch),
25 public class CodeTypeReferenceCollection : CollectionBase {
29 /// Initializes a new instance of <see cref='System.CodeDom.CodeTypeReferenceCollection'/>.
32 public CodeTypeReferenceCollection() {
37 /// Initializes a new instance of <see cref='System.CodeDom.CodeTypeReferenceCollection'/> based on another <see cref='System.CodeDom.CodeTypeReferenceCollection'/>.
40 public CodeTypeReferenceCollection(CodeTypeReferenceCollection value) {
46 /// Initializes a new instance of <see cref='System.CodeDom.CodeTypeReferenceCollection'/> containing any array of <see cref='System.CodeDom.CodeTypeReference'/> objects.
49 public CodeTypeReferenceCollection(CodeTypeReference[] value) {
54 /// <para>Represents the entry at the specified index of the <see cref='System.CodeDom.CodeTypeReference'/>.</para>
56 public CodeTypeReference this[int index] {
58 return ((CodeTypeReference)(List[index]));
66 /// <para>Adds a <see cref='System.CodeDom.CodeTypeReference'/> with the specified value to the
67 /// <see cref='System.CodeDom.CodeTypeReferenceCollection'/> .</para>
69 public int Add(CodeTypeReference value) {
70 return List.Add(value);
74 /// <para>[To be supplied.]</para>
76 public void Add(string value) {
77 Add(new CodeTypeReference(value));
81 /// <para>[To be supplied.]</para>
83 public void Add(Type value) {
84 Add(new CodeTypeReference(value));
88 /// <para>Copies the elements of an array to the end of the <see cref='System.CodeDom.CodeTypeReferenceCollection'/>.</para>
90 public void AddRange(CodeTypeReference[] value) {
92 throw new ArgumentNullException("value");
94 for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
101 /// Adds the contents of another <see cref='System.CodeDom.CodeTypeReferenceCollection'/> to the end of the collection.
104 public void AddRange(CodeTypeReferenceCollection value) {
106 throw new ArgumentNullException("value");
108 int currentCount = value.Count;
109 for (int i = 0; i < currentCount; i = ((i) + (1))) {
115 /// <para>Gets a value indicating whether the
116 /// <see cref='System.CodeDom.CodeTypeReferenceCollection'/> contains the specified <see cref='System.CodeDom.CodeTypeReference'/>.</para>
118 public bool Contains(CodeTypeReference value) {
119 return List.Contains(value);
123 /// <para>Copies the <see cref='System.CodeDom.CodeTypeReferenceCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
124 /// specified index.</para>
126 public void CopyTo(CodeTypeReference[] array, int index) {
127 List.CopyTo(array, index);
131 /// <para>Returns the index of a <see cref='System.CodeDom.CodeTypeReference'/> in
132 /// the <see cref='System.CodeDom.CodeTypeReferenceCollection'/> .</para>
134 public int IndexOf(CodeTypeReference value) {
135 return List.IndexOf(value);
139 /// <para>Inserts a <see cref='System.CodeDom.CodeTypeReference'/> into the <see cref='System.CodeDom.CodeTypeReferenceCollection'/> at the specified index.</para>
141 public void Insert(int index, CodeTypeReference value) {
142 List.Insert(index, value);
146 /// <para> Removes a specific <see cref='System.CodeDom.CodeTypeReference'/> from the
147 /// <see cref='System.CodeDom.CodeTypeReferenceCollection'/> .</para>
149 public void Remove(CodeTypeReference value) {