コード例 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = TestBoolean.GetHashCode();
         hashCode = (hashCode * 397) ^ TestDouble.GetHashCode();
         hashCode = (hashCode * 397) ^ TestInt;
         hashCode = (hashCode * 397) ^ (TestIntVector != null ? TestIntVector.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TestLong.GetHashCode();
         hashCode = (hashCode * 397) ^ (TestString != null ? TestString.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TestInt128.GetHashCode();
         hashCode = (hashCode * 397) ^ TestInt256.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
 public bool Equals(TestObject other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(TestBoolean.Equals(other.TestBoolean) && TestDouble.Equals(other.TestDouble) && TestInt == other.TestInt && TestIntVector.SequenceEqual(other.TestIntVector) &&
            TestLong == other.TestLong && string.Equals(TestString, other.TestString) && TestInt128 == other.TestInt128 && TestInt256 == other.TestInt256);
 }