SessionRemoteExceptionCollection.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. namespace WinSCP
  5. {
  6. [Guid("2309282F-B89B-4F6B-AEB1-D3E1629B7033")]
  7. [ClassInterface(Constants.ClassInterface)]
  8. [ComVisible(true)]
  9. public class SessionRemoteExceptionCollection : ICollection<SessionRemoteException>
  10. {
  11. internal SessionRemoteExceptionCollection()
  12. {
  13. }
  14. public SessionRemoteException this[int index]
  15. {
  16. get
  17. {
  18. return _helper[index];
  19. }
  20. set
  21. {
  22. _helper[index] = value;
  23. }
  24. }
  25. #region ICollection<SessionRemoteException> Members
  26. public void Add(SessionRemoteException item)
  27. {
  28. _helper.Add(item);
  29. }
  30. public void Clear()
  31. {
  32. _helper.Clear();
  33. }
  34. public bool Contains(SessionRemoteException item)
  35. {
  36. return _helper.Contains(item);
  37. }
  38. public void CopyTo(SessionRemoteException[] array, int arrayIndex)
  39. {
  40. _helper.CopyTo(array, arrayIndex);
  41. }
  42. public int Count
  43. {
  44. get { return _helper.Count; }
  45. }
  46. public bool IsReadOnly
  47. {
  48. get { return _helper.IsReadOnly; }
  49. }
  50. public bool Remove(SessionRemoteException item)
  51. {
  52. return _helper.Remove(item);
  53. }
  54. #endregion
  55. #region IEnumerable<SessionRemoteException> Members
  56. IEnumerator<SessionRemoteException> IEnumerable<SessionRemoteException>.GetEnumerator()
  57. {
  58. return _helper.GetEnumerator();
  59. }
  60. #endregion
  61. #region IEnumerable Members
  62. public IEnumerator GetEnumerator()
  63. {
  64. return _helper.GetEnumerator();
  65. }
  66. #endregion
  67. internal void InternalAdd(SessionRemoteException item)
  68. {
  69. _helper.InternalAdd(item);
  70. }
  71. private readonly ReadOnlyInteropCollectionHelper<SessionRemoteException> _helper = new ReadOnlyInteropCollectionHelper<SessionRemoteException>();
  72. }
  73. }