Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Created != 0L)
            {
                hash ^= Created.GetHashCode();
            }
            if (Source.Length != 0)
            {
                hash ^= Source.GetHashCode();
            }
            if (Instance.Length != 0)
            {
                hash ^= Instance.GetHashCode();
            }
            if (msgCase_ == MsgOneofCase.Ka)
            {
                hash ^= Ka.GetHashCode();
            }
            if (msgCase_ == MsgOneofCase.Lg)
            {
                hash ^= Lg.GetHashCode();
            }
            if (msgCase_ == MsgOneofCase.Pc)
            {
                hash ^= Pc.GetHashCode();
            }
            if (msgCase_ == MsgOneofCase.Mc)
            {
                hash ^= Mc.GetHashCode();
            }
            hash ^= (int)msgCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Op != null)
                {
                    hash = hash * 59 + Op.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Ct != null)
                {
                    hash = hash * 59 + Ct.GetHashCode();
                }

                if (Clk != null)
                {
                    hash = hash * 59 + Clk.GetHashCode();
                }

                if (HeartbeatMs != null)
                {
                    hash = hash * 59 + HeartbeatMs.GetHashCode();
                }

                if (Pt != null)
                {
                    hash = hash * 59 + Pt.GetHashCode();
                }

                if (InitialClk != null)
                {
                    hash = hash * 59 + InitialClk.GetHashCode();
                }

                if (Mc != null)
                {
                    hash = hash * 59 + Mc.GetHashCode();
                }

                if (ConflateMs != null)
                {
                    hash = hash * 59 + ConflateMs.GetHashCode();
                }

                if (SegmentType != null)
                {
                    hash = hash * 59 + SegmentType.GetHashCode();
                }

                return(hash);
            }
        }