mscorlib(4.0.0.0) API with additions
CompilerErrorCollection.cs
1 using System.Collections;
3 
5 {
8  [PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
10  {
15  public CompilerError this[int index]
16  {
17  get
18  {
19  return (CompilerError)base.List[index];
20  }
21  set
22  {
23  base.List[index] = value;
24  }
25  }
26 
30  public bool HasErrors
31  {
32  get
33  {
34  if (base.Count > 0)
35  {
36  {
37  IEnumerator enumerator = GetEnumerator();
38  try
39  {
40  while (enumerator.MoveNext())
41  {
42  CompilerError compilerError = (CompilerError)enumerator.Current;
43  if (!compilerError.IsWarning)
44  {
45  return true;
46  }
47  }
48  }
49  finally
50  {
51  IDisposable disposable = enumerator as IDisposable;
52  if (disposable != null)
53  {
54  disposable.Dispose();
55  }
56  }
57  }
58  }
59  return false;
60  }
61  }
62 
66  public bool HasWarnings
67  {
68  get
69  {
70  if (base.Count > 0)
71  {
72  {
73  IEnumerator enumerator = GetEnumerator();
74  try
75  {
76  while (enumerator.MoveNext())
77  {
78  CompilerError compilerError = (CompilerError)enumerator.Current;
79  if (compilerError.IsWarning)
80  {
81  return true;
82  }
83  }
84  }
85  finally
86  {
87  IDisposable disposable = enumerator as IDisposable;
88  if (disposable != null)
89  {
90  disposable.Dispose();
91  }
92  }
93  }
94  }
95  return false;
96  }
97  }
98 
101  {
102  }
103 
109  {
110  AddRange(value);
111  }
112 
118  {
119  AddRange(value);
120  }
121 
125  public int Add(CompilerError value)
126  {
127  return base.List.Add(value);
128  }
129 
134  public void AddRange(CompilerError[] value)
135  {
136  if (value == null)
137  {
138  throw new ArgumentNullException("value");
139  }
140  for (int i = 0; i < value.Length; i++)
141  {
142  Add(value[i]);
143  }
144  }
145 
151  {
152  if (value == null)
153  {
154  throw new ArgumentNullException("value");
155  }
156  int count = value.Count;
157  for (int i = 0; i < count; i++)
158  {
159  Add(value[i]);
160  }
161  }
162 
167  public bool Contains(CompilerError value)
168  {
169  return base.List.Contains(value);
170  }
171 
178  public void CopyTo(CompilerError[] array, int index)
179  {
180  base.List.CopyTo(array, index);
181  }
182 
186  public int IndexOf(CompilerError value)
187  {
188  return base.List.IndexOf(value);
189  }
190 
194  public void Insert(int index, CompilerError value)
195  {
196  base.List.Insert(index, value);
197  }
198 
202  public void Remove(CompilerError value)
203  {
204  base.List.Remove(value);
205  }
206  }
207 }
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
void Remove(CompilerError value)
Removes a specific T:System.CodeDom.Compiler.CompilerError from the collection.
bool MoveNext()
Advances the enumerator to the next element of the collection.
Provides the abstract base class for a strongly typed collection.
bool HasWarnings
Gets a value that indicates whether the collection contains warnings.
CompilerErrorCollection()
Initializes a new instance of the T:System.CodeDom.Compiler.CompilerErrorCollection class.
Represents a compiler error or warning.
Definition: CompilerError.cs:9
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
Definition: IDisposable.cs:8
Definition: __Canon.cs:3
IEnumerator GetEnumerator()
Returns an enumerator that iterates through the T:System.Collections.CollectionBase instance.
bool HasErrors
Gets a value that indicates whether the collection contains errors.
void AddRange(CompilerErrorCollection value)
Adds the contents of the specified compiler error collection to the end of the error collection.
CompilerErrorCollection(CompilerError[] value)
Initializes a new instance of T:System.CodeDom.Compiler.CompilerErrorCollection that contains the spe...
void AddRange(CompilerError[] value)
Copies the elements of an array to the end of the error collection.
SecurityAction
Specifies the security actions that can be performed using declarative security.
void Insert(int index, CompilerError value)
Inserts the specified T:System.CodeDom.Compiler.CompilerError into the collection at the specified in...
object Current
Gets the element in the collection at the current position of the enumerator.
Definition: IEnumerator.cs:15
int IndexOf(CompilerError value)
Gets the index of the specified T:System.CodeDom.Compiler.CompilerError object in the collection,...
int Add(CompilerError value)
Adds the specified T:System.CodeDom.Compiler.CompilerError object to the error collection.
bool IsWarning
Gets or sets a value that indicates whether the error is a warning.
Specifies that the class can be serialized.
void CopyTo(CompilerError[] array, int index)
Copies the collection values to a one-dimensional T:System.Array instance at the specified index.
CompilerErrorCollection(CompilerErrorCollection value)
Initializes a new instance of the T:System.CodeDom.Compiler.CompilerErrorCollection class that contai...
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
bool Contains(CompilerError value)
Gets a value that indicates whether the collection contains the specified T:System....
Supports a simple iteration over a non-generic collection.
Definition: IEnumerator.cs:9
Represents a collection of T:System.CodeDom.Compiler.CompilerError objects.