* support-test-*.cs: Rename from test-*-p2.cs.
[mono.git] / mcs / class / System / System.CodeDom / CodeDirectiveCollection.cs
1 //
2 // System.CodeDom CodeDirectiveCollection class
3 //
4 // Authors:
5 //      Marek Safar (marek.safar@seznam.cz)
6 //      Sebastien Pouliot  <sebastien@ximian.com>
7 //
8 // (C) 2004 Ximian, Inc.
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 #if NET_2_0
32
33 using System.Runtime.InteropServices;
34
35 namespace System.CodeDom
36 {
37         [Serializable]
38         [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)]
39         public class CodeDirectiveCollection: System.Collections.CollectionBase {
40
41                 public CodeDirectiveCollection ()
42                 {
43                 }
44
45                 public CodeDirectiveCollection (CodeDirective[] value)
46                 {
47                         AddRange (value);
48                 }
49
50                 public CodeDirectiveCollection (CodeDirectiveCollection value)
51                 {
52                         AddRange (value);
53                 }
54
55
56                 public CodeDirective this [int index] {
57                         get { return (CodeDirective) List [index]; }
58                         set { List [index] = value; }
59                 }
60
61
62                 public int Add (CodeDirective value)
63                 {
64                         return List.Add (value);
65                 }
66
67                 public void AddRange (CodeDirective[] value)
68                 {
69                         if (value == null) {
70                                 throw new ArgumentNullException ("value");
71                         }
72
73                         for (int i = 0; i < value.Length; i++) {
74                                 Add (value[i]);
75                         }
76                 }
77                 
78                 public void AddRange (CodeDirectiveCollection value)
79                 {
80                         if (value == null) {
81                                 throw new ArgumentNullException ("value");
82                         }
83
84                         int count = value.Count;
85                         for (int i = 0; i < count; i++) {
86                                 Add (value[i]);
87                         }
88                 }
89
90                 public bool Contains (CodeDirective value)
91                 {
92                         return List.Contains (value);
93                 }
94                 
95                 public void CopyTo (CodeDirective[] array, int index)
96                 {
97                         List.CopyTo (array, index);
98                 }
99
100                 public int IndexOf (CodeDirective value)
101                 {
102                         return List.IndexOf (value);
103                 }
104
105                 public void Insert (int index, CodeDirective value)
106                 {
107                         List.Insert (index, value);
108                 }
109
110                 public void Remove (CodeDirective value)
111                 {
112                         List.Remove (value);
113                 }
114         }
115 }
116
117 #endif