Add support for ToolsVersion and correctly build msbuild+xbuild assemblies
[mono.git] / mcs / class / System / System.CodeDom.Compiler / CompilerErrorCollection.cs
1 //
2 // System.CodeDom.Compiler.CompilerErrorCollection.cs
3 //
4 // Authors:
5 //   Daniel Stodden (stodden@in.tum.de)
6 //   Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 //
8 // (C) 2002 Ximian, Inc. (http://www.ximian.com)
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 using System.Collections;
32 using System.Security.Permissions;
33
34 namespace System.CodeDom.Compiler {
35
36         [Serializable]
37 #if ONLY_1_1
38         [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
39 #endif
40         public class CompilerErrorCollection : CollectionBase
41         {
42                 public CompilerErrorCollection ()
43                 {
44                 }
45
46                 public CompilerErrorCollection (CompilerErrorCollection value)
47                 {
48                         InnerList.AddRange(value.InnerList);
49                 }
50
51                 public CompilerErrorCollection (CompilerError[] value)
52                 {
53                         InnerList.AddRange(value);
54                 }
55
56                 public int Add (CompilerError value)
57                 {
58                         return InnerList.Add(value);
59                 }
60
61                 public void AddRange (CompilerError[] value)
62                 {
63                         InnerList.AddRange(value);
64                 }
65
66                 public void AddRange (CompilerErrorCollection value)
67                 {
68                         InnerList.AddRange(value.InnerList);
69                 }
70
71                 public bool Contains (CompilerError value)
72                 {
73                         return InnerList.Contains(value);
74                 }
75
76                 public void CopyTo (CompilerError[] array, int index)
77                 {
78                         InnerList.CopyTo(array,index);
79                 }
80
81                 public int IndexOf (CompilerError value)
82                 {
83                         return InnerList.IndexOf(value);
84                 }
85
86                 public void Insert (int index, CompilerError value)
87                 {
88                         InnerList.Insert(index,value);
89                 }
90
91                 public void Remove (CompilerError value)
92                 {
93                         InnerList.Remove(value);
94                 }
95
96                 public CompilerError this [int index] {
97                         get { return (CompilerError) InnerList[index]; }
98                         set { InnerList[index]=value; }
99                 }
100
101                 public bool HasErrors {
102                         get {
103                                 foreach (CompilerError error in InnerList)
104                                         if (!error.IsWarning) return true;
105                                 return false;
106                         }
107                 }
108
109                 public bool HasWarnings {
110                         get {
111                                 foreach (CompilerError error in InnerList)
112                                         if (error.IsWarning) return true;
113                                 return false;
114                         }
115                 }
116         }
117 }
118