Пример #1
0
        public override int GetHashCode()
        {
            // https://www.loganfranken.com/blog/692/overriding-equals-in-c-part-2/
            unchecked
            {
                const int hashingBase       = (int)2166136261;
                const int hashingMultiplier = 16777619;

                int hash = hashingBase;
                hash = (hash * hashingMultiplier) ^
                       (!ReferenceEquals(null, SubjectName) ? SubjectName.GetHashCode() : 0);
                hash = (hash * hashingMultiplier) ^
                       (!ReferenceEquals(null, TeacherName) ? TeacherName.GetHashCode() : 0);
                hash = (hash * hashingMultiplier) ^
                       (!ReferenceEquals(null, ClassType) ? ClassType.GetHashCode() : 0);
                hash = (hash * hashingMultiplier) ^
                       (!ReferenceEquals(null, DayOfWeek) ? DayOfWeek.GetHashCode() : 0);
                hash = (hash * hashingMultiplier) ^
                       (!ReferenceEquals(null, TimeSegmentStart) ? TimeSegmentStart.GetHashCode() : 0);
                hash = (hash * hashingMultiplier) ^
                       (!ReferenceEquals(null, TimeSegmentCount) ? TimeSegmentCount.GetHashCode() : 0);

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

            if (Content.Length != 0)
            {
                hash ^= Content.GetHashCode();
            }
            if (MimeType.Length != 0)
            {
                hash ^= MimeType.GetHashCode();
            }
            if (TimeSegmentStart.Length != 0)
            {
                hash ^= TimeSegmentStart.GetHashCode();
            }
            if (TimeSegmentEnd.Length != 0)
            {
                hash ^= TimeSegmentEnd.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (DisplayName.Length != 0)
            {
                hash ^= DisplayName.GetHashCode();
            }
            if (timeSegmentStart_ != null)
            {
                hash ^= TimeSegmentStart.GetHashCode();
            }
            if (timeSegmentEnd_ != null)
            {
                hash ^= TimeSegmentEnd.GetHashCode();
            }
            if (confidence_ != null)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableSingleEqualityComparer.GetHashCode(Confidence);
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }