コード例 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (VersionTag.Length != 0)
            {
                hash ^= VersionTag.GetHashCode();
            }
            if (Ips.Length != 0)
            {
                hash ^= Ips.GetHashCode();
            }
            if (Ports.Length != 0)
            {
                hash ^= Ports.GetHashCode();
            }
            if (ResourceUrl.Length != 0)
            {
                hash ^= ResourceUrl.GetHashCode();
            }
            if (VersionUrl.Length != 0)
            {
                hash ^= VersionUrl.GetHashCode();
            }
            if (ShowState != false)
            {
                hash ^= ShowState.GetHashCode();
            }
            if (SelectServer != false)
            {
                hash ^= SelectServer.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (ApiKey != null)
                {
                    hashCode = hashCode * 59 + ApiKey.GetHashCode();
                }

                if (UserId != null)
                {
                    hashCode = hashCode * 59 + UserId.GetHashCode();
                }

                if (Ips != null)
                {
                    hashCode = hashCode * 59 + Ips.GetHashCode();
                }

                if (Note != null)
                {
                    hashCode = hashCode * 59 + Note.GetHashCode();
                }

                if (Permissions != null)
                {
                    hashCode = hashCode * 59 + Permissions.GetHashCode();
                }

                if (CreatedAt != null)
                {
                    hashCode = hashCode * 59 + CreatedAt.GetHashCode();
                }

                if (ReadOnly != null)
                {
                    hashCode = hashCode * 59 + ReadOnly.GetHashCode();
                }

                return(hashCode);
            }
        }