CompilerErrorCollection.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // System.CodeDom.Compiler.CompilerErrorCollection.cs
  3. //
  4. // Authors:
  5. // Daniel Stodden ([email protected])
  6. // Gonzalo Paniagua Javier ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc. (http://www.ximian.com)
  9. //
  10. using System.Collections;
  11. namespace System.CodeDom.Compiler
  12. {
  13. [Serializable ()]
  14. public class CompilerErrorCollection : CollectionBase
  15. {
  16. public CompilerErrorCollection ()
  17. {
  18. }
  19. public CompilerErrorCollection (CompilerErrorCollection value)
  20. {
  21. InnerList.AddRange(value.InnerList);
  22. }
  23. public CompilerErrorCollection (CompilerError[] value)
  24. {
  25. InnerList.AddRange(value);
  26. }
  27. public int Add (CompilerError value)
  28. {
  29. return InnerList.Add(value);
  30. }
  31. public void AddRange (CompilerError[] value)
  32. {
  33. InnerList.AddRange(value);
  34. }
  35. public void AddRange (CompilerErrorCollection value)
  36. {
  37. InnerList.AddRange(value.InnerList);
  38. }
  39. public bool Contains (CompilerError value)
  40. {
  41. return InnerList.Contains(value);
  42. }
  43. public void CopyTo (CompilerError[] array, int index)
  44. {
  45. InnerList.CopyTo(array,index);
  46. }
  47. public int IndexOf (CompilerError value)
  48. {
  49. return InnerList.IndexOf(value);
  50. }
  51. public void Insert (int index, CompilerError value)
  52. {
  53. InnerList.Insert(index,value);
  54. }
  55. public void Remove (CompilerError value)
  56. {
  57. InnerList.Remove(value);
  58. }
  59. public CompilerError this [int index] {
  60. get { return (CompilerError) InnerList[index]; }
  61. set { InnerList[index]=value; }
  62. }
  63. public bool HasErrors {
  64. get {
  65. foreach (CompilerError error in InnerList)
  66. if (!error.IsWarning) return true;
  67. return false;
  68. }
  69. }
  70. public bool HasWarnings {
  71. get {
  72. foreach (CompilerError error in InnerList)
  73. if (error.IsWarning) return true;
  74. return false;
  75. }
  76. }
  77. }
  78. }