c7f7b5a7a40ea6fbf34c9fc31e3aaccf3567b96a
[mono.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeDirectiveCollection.cs
1 // ------------------------------------------------------------------------------
2 // <copyright file="CodeDirectiveCollection.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;
13     
14     
15     [
16         ClassInterface(ClassInterfaceType.AutoDispatch),
17         ComVisible(true),
18         Serializable()
19     ]
20     public class CodeDirectiveCollection : CollectionBase {
21         
22         public CodeDirectiveCollection() {
23         }
24         
25         public CodeDirectiveCollection(CodeDirectiveCollection value) {
26             this.AddRange(value);
27         }
28         
29         public CodeDirectiveCollection(CodeDirective[] value) {
30             this.AddRange(value);
31         }
32         
33         public CodeDirective this[int index] {
34             get {
35                 return ((CodeDirective)(List[index]));
36             }
37             set {
38                 List[index] = value;
39             }
40         }
41         
42         public int Add(CodeDirective value) {
43             return List.Add(value);
44         }
45         
46         public void AddRange(CodeDirective[] value) {
47             if (value == null) {
48                 throw new ArgumentNullException("value");
49             }
50             for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
51                 this.Add(value[i]);
52             }
53         }
54         
55         public void AddRange(CodeDirectiveCollection value) {
56             if (value == null) {
57                 throw new ArgumentNullException("value");
58             }
59             int currentCount = value.Count;
60             for (int i = 0; i < currentCount; i = ((i) + (1))) {
61                 this.Add(value[i]);
62             }
63         }
64         
65         public bool Contains(CodeDirective value) {
66             return List.Contains(value);
67         }
68         
69         public void CopyTo(CodeDirective[] array, int index) {
70             List.CopyTo(array, index);
71         }
72         
73         public int IndexOf(CodeDirective value) {
74             return List.IndexOf(value);
75         }
76         
77         public void Insert(int index, CodeDirective value) {
78             List.Insert(index, value);
79         }
80         
81         public void Remove(CodeDirective value) {
82             List.Remove(value);
83         }
84     }
85 }