Exemple #1
0
        /// <summary>
        ///     Returns a hash code for this instance.
        /// </summary>
        /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = MemoryRanges != null?MemoryRanges.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Start != null ? Start.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (End != null ? End.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (BreakpointMasks != null
                               ? BreakpointMasks.Select(x => x.GetHashCode()).Aggregate((x, y) => x ^ y)
                               : 0);
                hashCode = (hashCode * 397) ^ (AccessBreakpoints != null
                               ? AccessBreakpoints.Select(x => x.GetHashCode()).Aggregate((x, y) => x ^ y)
                               : 0);
                hashCode = (hashCode * 397) ^ Step;
                return(hashCode);
            }
        }
Exemple #2
0
 /// <summary>
 ///     Determines whether the specified <see cref="IndexOptions" /> is equal to this instance.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 public bool Equals(IndexOptions other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return
         (Equals(Start, other.Start) &&
          Equals(End, other.End) &&
          (MemoryRanges?.SequenceEqual(other.MemoryRanges)).GetValueOrDefault(true) &&
          (BreakpointMasks?.SequenceEqual(other.BreakpointMasks)).GetValueOrDefault(true) &&
          (AccessBreakpoints?.SequenceEqual(other.AccessBreakpoints)).GetValueOrDefault(true) &&
          Step == other.Step);
 }