コード例 #1
0
        /// <summary>
        /// Serves as the default hash function.
        /// </summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
            var hashcode = ID.GetHashCode();

            hashcode ^= IdentityGUID.GetHashCode();
            hashcode ^= CheckpointIP.GetHashCode();
            hashcode ^= Date.GetHashCode();
            hashcode ^= Status.GetHashCode();
            hashcode ^= ModeID.GetHashCode();
            hashcode ^= Mode.GetHashCode();
            return(hashcode);
        }
コード例 #2
0
        /// <summary>
        /// Determines whether the specified object is equal to the current object.
        /// </summary>
        /// <param name="obj">The object to compare with the current object.</param>
        /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
        public override bool Equals(object obj)
        {
            var result = false;

            if (obj is Activity item)
            {
                result  = ID == item.ID;
                result &= IdentityGUID.Equals(item.IdentityGUID);
                result &= CheckpointIP.Equals(item.CheckpointIP);
                result &= Date.Equals(item.Date);
                result &= Status.Equals(item.Status);
                result &= ModeID.Equals(item.ModeID);
                result &= Mode.Equals(item.Mode);
                return(result);
            }
            return(false);
        }