OdbcErrorCollection.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // System.Data.Odbc.OdbcErrorCollection
  3. //
  4. // Author:
  5. // Brian Ritchie ([email protected])
  6. //
  7. // Copyright (C) Brian Ritchie, 2002
  8. //
  9. using System.Collections;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Data.Common;
  13. namespace System.Data.Odbc
  14. {
  15. public sealed class OdbcErrorCollection : ICollection, IEnumerable
  16. {
  17. #region Fields
  18. ArrayList list = new ArrayList ();
  19. #endregion // Fields
  20. #region Properties
  21. public int Count
  22. {
  23. get
  24. {
  25. return list.Count;
  26. }
  27. }
  28. public OdbcError this[int index]
  29. {
  30. get
  31. {
  32. return (OdbcError) list[index];
  33. }
  34. }
  35. object ICollection.SyncRoot
  36. {
  37. get
  38. {
  39. return list.SyncRoot;
  40. }
  41. }
  42. bool ICollection.IsSynchronized
  43. {
  44. get
  45. {
  46. return list.IsSynchronized;
  47. }
  48. }
  49. #endregion // Properties
  50. #region Methods
  51. public void Add (OdbcError error)
  52. {
  53. list.Add ((object) error);
  54. }
  55. [MonoTODO]
  56. public void CopyTo (Array array, int index)
  57. {
  58. ((OdbcError[])(list.ToArray ())).CopyTo (array, index);
  59. throw new NotImplementedException ();
  60. }
  61. public IEnumerator GetEnumerator ()
  62. {
  63. return list.GetEnumerator ();
  64. }
  65. IEnumerator IEnumerable.GetEnumerator ()
  66. {
  67. return GetEnumerator ();
  68. }
  69. #endregion // Methods
  70. }
  71. }