ComparisonDifferenceCollection.cs 2.1 KB

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