SQLiteStatementCollection.cs 944 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #region Using directives
  2. using System;
  3. using System.Collections;
  4. #endregion
  5. namespace System.Data.SQLiteClient
  6. {
  7. internal class SQLiteStatementCollection : CollectionBase, IDisposable
  8. {
  9. public SQLiteStatementCollection()
  10. {
  11. }
  12. public void Add(SQLiteStatement statement)
  13. {
  14. List.Add(statement);
  15. }
  16. public SQLiteStatement this[int index]
  17. {
  18. get
  19. {
  20. if (index < 0 || index >= Count) throw new IndexOutOfRangeException();
  21. return List[index] as SQLiteStatement;
  22. }
  23. }
  24. #region IDisposable Members
  25. public void Dispose()
  26. {
  27. for (int i = 0; i < Count; ++i)
  28. {
  29. SQLiteStatement statement = this[i];
  30. statement.Dispose();
  31. }
  32. }
  33. #endregion
  34. }
  35. }