コード例 #1
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 (Type != null)
                {
                    hash = hash * 59 + Type.GetHashCode();
                }

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

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

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

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

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

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

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

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

                return(hash);
            }
        }