SQLiteCommandCollection.cs 990 B

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