コード例 #1
0
        public override int GetHashCode()
        {
            var hashCode = 291051517;

            hashCode = hashCode * -1521134295 + Int.GetHashCode();
            hashCode = hashCode * -1521134295 + Long.GetHashCode();
            hashCode = hashCode * -1521134295 + Short.GetHashCode();
            hashCode = hashCode * -1521134295 + UInt.GetHashCode();
            hashCode = hashCode * -1521134295 + ULong.GetHashCode();
            hashCode = hashCode * -1521134295 + UShort.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <int?> .Default.GetHashCode(NullableInt);

            hashCode = hashCode * -1521134295 + Byte.GetHashCode();
            hashCode = hashCode * -1521134295 + SByte.GetHashCode();
            hashCode = hashCode * -1521134295 + Bool.GetHashCode();
            hashCode = hashCode * -1521134295 + Float.GetHashCode();
            hashCode = hashCode * -1521134295 + Double.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <byte[]> .Default.GetHashCode(ByteArray);

            hashCode = hashCode * -1521134295 + Decimal.GetHashCode();
            hashCode = hashCode * -1521134295 + DateTime.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(String);

            return(hashCode);
        }
コード例 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Int32;
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         return(hashCode);
     }
 }
コード例 #3
0
        public override int GetHashCode()
        {
            var hash = base.GetHashCode();

            hash ^= Readonly.GetHashCode();
            hash ^= IntId.GetHashCode();
            hash ^= UIntId.GetHashCode();
            hash ^= LongId.GetHashCode();
            hash ^= ULongId.GetHashCode();
            hash ^= ShortId.GetHashCode();
            hash ^= UShortId.GetHashCode();
            hash ^= DoulbeId.GetHashCode();
            hash ^= ByteId.GetHashCode();
            hash ^= CharId.GetHashCode();
            hash ^= SByteId.GetHashCode();
            hash ^= CharRef.GetHashCode();
            hash ^= ByteRef.GetHashCode();
            hash ^= SByteRef.GetHashCode();
            hash ^= Int16Id.GetHashCode();
            hash ^= UInt16Id.GetHashCode();
            hash ^= Int32Id.GetHashCode();
            hash ^= UInt32Id.GetHashCode();
            hash ^= Int64Id.GetHashCode();
            hash ^= UInt64Id.GetHashCode();
            hash ^= DateTime.GetHashCode();
            hash ^= TitleEnum.GetHashCode();
            hash ^= ATitleEnum.GetHashCode();
            hash ^= FirstName.GetHashCode();
            hash ^= LastName.GetHashCode();
            hash ^= Bool.GetHashCode();
            hash ^= BoolRef.GetHashCode();
            if (Array != null)
            {
                hash ^= Array.GetHashCode();
            }
            if (Enumerable != null)
            {
                hash ^= Enumerable.GetHashCode();
            }
            if (Father != null)
            {
                hash ^= Father.GetHashCode();
            }
            if (Mother != null)
            {
                hash ^= Mother.GetHashCode();
            }
            if (Hidden != null)
            {
                hash ^= Hidden.GetHashCode();
            }
            return(hash);
        }
コード例 #4
0
        public override int GetHashCode()
        {
            var hash = 19;

            hash = hash * 7 + Bool.GetHashCode();
            hash = hash * 7 + Int.GetHashCode();
            hash = hash * 7 + UInt.GetHashCode();
            hash = hash * 7 + Float.GetHashCode();
            hash = hash * 7 + Char.GetHashCode();
            hash = hash * 7 + Str.GetHashCode();

            return(hash);
        }
コード例 #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ID.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         return(hashCode);
     }
 }
コード例 #6
0
ファイル: BoolTest.cs プロジェクト: TYoung86/VulkanCore
        public void Equals()
        {
            Bool boolTrue  = true;
            Bool boolFalse = false;

            Assert.True(boolTrue.Equals(boolTrue));
            Assert.False(boolTrue.Equals(boolFalse));
            Assert.True(boolTrue == boolTrue);
            Assert.False(boolTrue == boolFalse);
            Assert.False(boolTrue != boolTrue);
            Assert.True(boolTrue != boolFalse);
            Assert.Equal(true.GetHashCode(), boolTrue.GetHashCode());
            Assert.Equal(false.GetHashCode(), boolFalse.GetHashCode());
        }
コード例 #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = ID.GetHashCode();
         hashCode = (hashCode * 397) ^ (StringDefault != null ? StringDefault.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntIList != null ? IntIList.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ ArrayReaderTestId;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ String.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         return(hashCode);
     }
 }
コード例 #9
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)UInt;
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Char.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ (ByteArray != null ? ByteArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CharArray != null ? CharArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LongArray != null ? LongArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubTypes != null ? SubTypes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomText != null ? CustomText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MaxText != null ? MaxText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomDecimal.GetHashCode();
         return(hashCode);
     }
 }
コード例 #10
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Character.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ SByte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)UInt;
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         return(hashCode);
     }
 }
コード例 #11
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = _int1;
         result = (result * 397) ^ Bool.GetHashCode();
         result = (result * 397) ^ (NullableBool.HasValue ? NullableBool.Value.GetHashCode() : 0);
         result = (result * 397) ^ Int;
         result = (result * 397) ^ Uint.GetHashCode();
         result = (result * 397) ^ (NullableInt.HasValue ? NullableInt.Value : 0);
         result = (result * 397) ^ (NullableUint.HasValue ? NullableUint.Value.GetHashCode() : 0);
         result = (result * 397) ^ Byte.GetHashCode();
         result = (result * 397) ^ Sbyte.GetHashCode();
         result = (result * 397) ^ (NullableByte.HasValue ? NullableByte.Value.GetHashCode() : 0);
         result = (result * 397) ^ (NullableSbyte.HasValue ? NullableSbyte.Value.GetHashCode() : 0);
         result = (result * 397) ^ Short.GetHashCode();
         result = (result * 397) ^ Ushort.GetHashCode();
         result = (result * 397) ^ (NullableShort.HasValue ? NullableShort.Value.GetHashCode() : 0);
         result = (result * 397) ^ (NullableUshort.HasValue ? NullableUshort.Value.GetHashCode() : 0);
         result = (result * 397) ^ Long.GetHashCode();
         result = (result * 397) ^ Ulong.GetHashCode();
         result = (result * 397) ^ (NullableLong.HasValue ? NullableLong.Value.GetHashCode() : 0);
         result = (result * 397) ^ (NullableUlong.HasValue ? NullableUlong.Value.GetHashCode() : 0);
         result = (result * 397) ^ Char.GetHashCode();
         result = (result * 397) ^ (NullableChar.HasValue ? NullableChar.Value.GetHashCode() : 0);
         result = (result * 397) ^ Float.GetHashCode();
         result = (result * 397) ^ (NullableFloat.HasValue ? NullableFloat.Value.GetHashCode() : 0);
         result = (result * 397) ^ Double.GetHashCode();
         result = (result * 397) ^ (NullableDouble.HasValue ? NullableDouble.Value.GetHashCode() : 0);
         result = (result * 397) ^ Decimal.GetHashCode();
         result = (result * 397) ^ (NullableDecimal.HasValue ? NullableDecimal.Value.GetHashCode() : 0);
         result = (result * 397) ^ (String != null ? String.GetHashCode() : 0);
         result = (result * 397) ^ (Object != null ? Object.GetHashCode() : 0);
         result = (result * 397) ^ TimeSpan.GetHashCode();
         result = (result * 397) ^ (NullableTimeSpan.HasValue ? NullableTimeSpan.Value.GetHashCode() : 0);
         result = (result * 397) ^ DateTime.GetHashCode();
         result = (result * 397) ^ (NullableDateTime.HasValue ? NullableDateTime.Value.GetHashCode() : 0);
         return(result);
     }
 }
コード例 #12
0
ファイル: BoolTest.cs プロジェクト: CarlSample/daml-net
 public void HashCodeHasValueSemantics()
 {
     Assert.IsTrue(_falseBool.GetHashCode() == _false2Bool.GetHashCode());
     Assert.IsTrue(_falseBool.GetHashCode() != _trueBool.GetHashCode());
 }
コード例 #13
0
ファイル: TestClass.cs プロジェクト: Daloupe/ModelReader
 public override int GetHashCode()
 {
     return(Bool.GetHashCode() ^ Number ^ Id.GetHashCode() ^ Name.GetHashCode());
 }