Example #1
0
        public override int GetHashCode()
        {
            var hashCode = 1022390368;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + DisplayName.GetHashCode();
            hashCode = hashCode * -1521134295 + EntityType.GetHashCode();
            hashCode = hashCode * -1521134295 + ClassName.GetHashCode();
            return(hashCode);
        }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ClassName != null ? ClassName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AsString != null ? AsString.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Image != null ? Image.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Hash;
         hashCode = (hashCode * 397) ^ IsTrue.GetHashCode();
         return(hashCode);
     }
 }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = (_lexInfo != null ? _lexInfo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Level;
         hashCode = (hashCode * 397) ^ (int)Type;
         hashCode = (hashCode * 397) ^ (int)Phase;
         hashCode = (hashCode * 397) ^ (Message != null ? Message.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ClassName != null ? ClassName.GetHashCode() : 0);
         return(hashCode);
     }
 }
        /// <summary>
        /// Provides a representative hash code for objects of this type to spread out distribution
        /// in hash tables.
        /// </summary>
        /// <remarks>Objects which consider themselves to be Equal (a.Equals(b) returns true) are
        /// expected to have the same hash code.  Objects which are not Equal may have the same
        /// hash code, but minimizing such overlaps helps with efficient operation of hash tables.
        /// </remarks>
        /// <returns>
        /// an int representing the hash code calculated for the contents of this object
        /// </returns>
        public override int GetHashCode()
        {
            int myHash = base.GetHashCode(); // Fold in hash code for inherited base type

            myHash ^= (int)Severity;         // Fold in Severity (enum) as an int as its own hash code
            myHash ^= Id.GetHashCode();      // Fold in hash code for GUID
            if (Caption != null)
            {
                myHash ^= Caption.GetHashCode();                  // Fold in hash code for string Caption
            }
            if (Description != null)
            {
                myHash ^= Description.GetHashCode();                      // Fold in hash code for string Caption
            }
            if (Details != null)
            {
                myHash ^= Details.GetHashCode();                  // Fold in hash code for string Caption
            }
            if (LogSystem != null)
            {
                myHash ^= LogSystem.GetHashCode();                    // Fold in hash code for string LogSystem
            }
            if (CategoryName != null)
            {
                myHash ^= CategoryName.GetHashCode();                       // Fold in hash code for string CategoryName
            }
            if (UserName != null)
            {
                myHash ^= UserName.GetHashCode();                   // Fold in hash code for string UserName
            }
            if (MethodName != null)
            {
                myHash ^= MethodName.GetHashCode();                     // Fold in hash code for string MethodName
            }
            if (ClassName != null)
            {
                myHash ^= ClassName.GetHashCode();                    // Fold in hash code for string ClassName
            }
            if (FileName != null)
            {
                myHash ^= FileName.GetHashCode(); // Fold in hash code for string FileName
            }
            myHash ^= LineNumber;                 // Fold in LineNumber int as its own hash code
            myHash ^= ThreadId;                   // Fold in ThreadId int as its own hash code

            // Session member is not used in Equals, so we can't use it in hash calculation!

            return(myHash);
        }
        /// <nodoc/>
        /// <summary>
        ///    <para>[To be supplied.]</para>
        /// </summary>
        public override int GetHashCode()
        {
            // If all else fails, use the default implementation
            int result = base.GetHashCode();

            try {
                // Use the hash of the class name
                result = ClassName.GetHashCode();
            }
            catch (Exception e) {
                ManagementException.ThrowWithExtendedInfo(e);
            }

            return(result);
        }
Example #6
0
 public override int GetHashCode()
 {
     return(ClassName.GetHashCode() ^ TargetGroup.GetHashCode());
 }