StockHoldingGroup.cs 891 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. namespace PRS.Mobile
  4. {
  5. public class StockHoldingGroup
  6. {
  7. public String UnitSize { get; private set; }
  8. public StockHoldingGroup(String unitsize)
  9. {
  10. UnitSize = unitsize;
  11. }
  12. }
  13. public class StockHoldingGroupEqualityComparer : IEqualityComparer<StockHoldingGroup>
  14. {
  15. public bool Equals(StockHoldingGroup x, StockHoldingGroup y)
  16. {
  17. if (ReferenceEquals(x, y)) return true;
  18. if (ReferenceEquals(x, null)) return false;
  19. if (ReferenceEquals(y, null)) return false;
  20. if (x.GetType() != y.GetType()) return false;
  21. return x.UnitSize == y.UnitSize;
  22. }
  23. public int GetHashCode(StockHoldingGroup obj)
  24. {
  25. return (obj.UnitSize != null ? obj.UnitSize.GetHashCode() : 0);
  26. }
  27. }
  28. }