public int GetHashCode(StatisticInfo <T> obj) { unchecked { var hashCode = obj.Sum.GetHashCode(); hashCode = (hashCode * 397) ^ obj.Minus.GetHashCode(); hashCode = (hashCode * 397) ^ obj.Product.GetHashCode(); hashCode = (hashCode * 397) ^ (int)obj.Count; return(hashCode); } }
public int CompareTo(StatisticInfo <T> other) { var sumComparison = Sum.CompareTo(other.Sum); if (sumComparison != 0) { return(sumComparison); } var minusComparison = Minus.CompareTo(other.Minus); if (minusComparison != 0) { return(minusComparison); } var productComparison = Product.CompareTo(other.Product); if (productComparison != 0) { return(productComparison); } return(Count.CompareTo(other.Count)); }
public bool Equals(StatisticInfo <T> x, StatisticInfo <T> y) { return(x.Sum.Equals(y.Sum) && x.Minus.Equals(y.Minus) && x.Product.Equals(y.Product) && x.Count == y.Count); }
public bool Equals(StatisticInfo <T> other) { return(Sum.Equals(other.Sum) && Minus.Equals(other.Minus) && Product.Equals(other.Product) && Count == other.Count); }