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

            if (BoolValue != false)
            {
                hash ^= BoolValue.GetHashCode();
            }
            if (Int32Value != 0)
            {
                hash ^= Int32Value.GetHashCode();
            }
            if (Uint32Value != 0)
            {
                hash ^= Uint32Value.GetHashCode();
            }
            if (Int64Value != 0L)
            {
                hash ^= Int64Value.GetHashCode();
            }
            if (Uint64Value != 0UL)
            {
                hash ^= Uint64Value.GetHashCode();
            }
            if (Sint32Value != 0)
            {
                hash ^= Sint32Value.GetHashCode();
            }
            if (Sint64Value != 0L)
            {
                hash ^= Sint64Value.GetHashCode();
            }
            if (FloatValue != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FloatValue);
            }
            if (DoubleValue != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue);
            }
            if (EnumValue != 0)
            {
                hash ^= EnumValue.GetHashCode();
            }
            if (StringValue.Length != 0)
            {
                hash ^= StringValue.GetHashCode();
            }
            return(hash);
        }
예제 #2
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (oneofCase_ == OneofOneofCase.Int32Value)
        {
            hash ^= Int32Value.GetHashCode();
        }
        if (oneofCase_ == OneofOneofCase.StringValue)
        {
            hash ^= StringValue.GetHashCode();
        }
        hash ^= (int)oneofCase_;
        return(hash);
    }
                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);
                }