예제 #1
0
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (kindCase_ == KindOneofCase.StringValue)
                    {
                        hash ^= StringValue.GetHashCode();
                    }
                    if (kindCase_ == KindOneofCase.FloatValue)
                    {
                        hash ^= FloatValue.GetHashCode();
                    }
                    if (kindCase_ == KindOneofCase.DoubleValue)
                    {
                        hash ^= DoubleValue.GetHashCode();
                    }
                    if (kindCase_ == KindOneofCase.IntValue)
                    {
                        hash ^= IntValue.GetHashCode();
                    }
                    if (kindCase_ == KindOneofCase.UintValue)
                    {
                        hash ^= UintValue.GetHashCode();
                    }
                    if (kindCase_ == KindOneofCase.SintValue)
                    {
                        hash ^= SintValue.GetHashCode();
                    }
                    if (kindCase_ == KindOneofCase.BoolValue)
                    {
                        hash ^= BoolValue.GetHashCode();
                    }
                    hash ^= (int)kindCase_;
                    return(hash);
                }
예제 #2
0
        /// <summary>
        /// Overriden. Returns a hash code for the current Object.
        /// </summary>
        /// <returns>A hash code for the current Object.</returns>
        public override int GetHashCode()
        {
            switch (ValueType)
            {
            case ValueTypeDefinitionData.Reference:
                return(ReferenceValue.GetHashCode());

            case ValueTypeDefinitionData.DateTime:
                return(DateTimeValue.GetHashCode());

            case ValueTypeDefinitionData.Bool:
                return(BoolValue.GetHashCode());

            case ValueTypeDefinitionData.Float:
                return(FloatValue.GetHashCode());

            case ValueTypeDefinitionData.Int:
                return(IntValue.GetHashCode());

            case ValueTypeDefinitionData.StringNonUnicode:
                return(StringNonUnicodeValue.GetHashCode());

            default:
                return(base.GetHashCode());
            }
        }
예제 #3
0
        public override Int32 GetHashCode()
        {
            switch (NumberType)
            {
            case NumberType.Int:
                return(IntValue.GetHashCode());

            case NumberType.Float:
                return(FloatValue.GetHashCode());

            default:
                return(0);
            }
        }
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (Type != 0)
                    {
                        hash ^= Type.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.Int32Value)
                    {
                        hash ^= Int32Value.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.Int64Value)
                    {
                        hash ^= Int64Value.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.FloatValue)
                    {
                        hash ^= FloatValue.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.DoubleValue)
                    {
                        hash ^= DoubleValue.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.BooleanValue)
                    {
                        hash ^= BooleanValue.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.StringValue)
                    {
                        hash ^= StringValue.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.BytesValue)
                    {
                        hash ^= BytesValue.GetHashCode();
                    }
                    if (valueCase_ == ValueOneofCase.MetaValue)
                    {
                        hash ^= MetaValue.GetHashCode();
                    }
                    hash ^= (int)valueCase_;
                    return(hash);
                }
예제 #5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BoolValue != false)
            {
                hash ^= BoolValue.GetHashCode();
            }
            if (IntValue != 0L)
            {
                hash ^= IntValue.GetHashCode();
            }
            if (FloatValue != 0D)
            {
                hash ^= FloatValue.GetHashCode();
            }
            if (StringValue.Length != 0)
            {
                hash ^= StringValue.GetHashCode();
            }
            if (BlobValue.Length != 0)
            {
                hash ^= BlobValue.GetHashCode();
            }
            if (MessageValue.Length != 0)
            {
                hash ^= MessageValue.GetHashCode();
            }
            if (FourccValue.Length != 0)
            {
                hash ^= FourccValue.GetHashCode();
            }
            if (UintValue != 0UL)
            {
                hash ^= UintValue.GetHashCode();
            }
            if (entityIdValue_ != null)
            {
                hash ^= EntityIdValue.GetHashCode();
            }
            return(hash);
        }
예제 #6
0
        public override int GetHashCode()
        {
            int hashCode = 0;

            if (this.GetType() == typeof(LongPropertyValue))
            {
                hashCode = LongValue.GetHashCode();
            }
            else if (this.GetType() == typeof(LongPropertyValues))
            {
                foreach (long longValue in LongValues)
                {
                    hashCode += longValue.GetHashCode();
                }
            }
            else if (this.GetType() == typeof(FloatPropertyValue))
            {
                hashCode = FloatValue.GetHashCode();
            }
            else if (this.GetType() == typeof(StringPropertyValue))
            {
                hashCode = StringValue.GetHashCode();
            }
            else if (this.GetType() == typeof(FloatPropertyValues))
            {
                foreach (float floatValue in FloatValues)
                {
                    hashCode += floatValue.GetHashCode();
                }
            }
            else if (this.GetType() == typeof(StringPropertyValues))
            {
                foreach (String stringValue in StringValues)
                {
                    hashCode += stringValue.GetHashCode();
                }
            }

            return(hashCode);
        }
예제 #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = CharValue.GetHashCode();
         hashCode = (hashCode * 397) ^ ByteValue.GetHashCode();
         hashCode = (hashCode * 397) ^ SByteValue.GetHashCode();
         hashCode = (hashCode * 397) ^ ShortValue.GetHashCode();
         hashCode = (hashCode * 397) ^ UShortValue.GetHashCode();
         hashCode = (hashCode * 397) ^ IntValue;
         hashCode = (hashCode * 397) ^ (int)UIntValue;
         hashCode = (hashCode * 397) ^ LongValue.GetHashCode();
         hashCode = (hashCode * 397) ^ ULongValue.GetHashCode();
         hashCode = (hashCode * 397) ^ FloatValue.GetHashCode();
         hashCode = (hashCode * 397) ^ DoubleValue.GetHashCode();
         hashCode = (hashCode * 397) ^ DecimalValue.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeValue.GetHashCode();
         hashCode = (hashCode * 397) ^ GuidValue.GetHashCode();
         hashCode = (hashCode * 397) ^ StringValue.GetHashCode();
         return(hashCode);
     }
 }