Beispiel #1
0
        public override int GetHashCode()
        {
            // See: http://stackoverflow.com/a/263416/19818
            const int BASE  = 151;
            const int MIXER = 2011;

            unchecked // Overflow is fine
            {
                int hash = BASE;

                hash = hash * MIXER + HttpPort.GetHashCode();
                hash = hash * MIXER + TcpPort.GetHashCode();

                if (BroadcastAddress != null)
                {
                    hash = hash * MIXER + BroadcastAddress.GetHashCode();
                }

                if (HostName != null)
                {
                    hash = hash * MIXER + HostName.GetHashCode();
                }

                return(hash);
            }
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }
                if (HostName != null)
                {
                    hashCode = hashCode * 59 + HostName.GetHashCode();
                }

                hashCode = hashCode * 59 + Port.GetHashCode();

                hashCode = hashCode * 59 + IsLdaps.GetHashCode();
                if (Account != null)
                {
                    hashCode = hashCode * 59 + Account.GetHashCode();
                }
                if (BaseDn != null)
                {
                    hashCode = hashCode * 59 + BaseDn.GetHashCode();
                }
                if (LdapAttributes != null)
                {
                    hashCode = hashCode * 59 + LdapAttributes.GetHashCode();
                }
                return(hashCode);
            }
        }
 public override int GetHashCode()
 {
     unchecked
     {
         return(((HostName?.GetHashCode() ?? 0) * 397) ^ Port.GetHashCode());
     }
 }
Beispiel #4
0
 ///<summary>Implementation of hash code depending on protocol,
 ///hostname and port, to line up with the implementation of
 ///Equals()</summary>
 public override int GetHashCode()
 {
     return
         (Protocol.GetHashCode() ^
          HostName.GetHashCode() ^
          Port);
 }
 public override int GetHashCode()
 {
     unchecked
     {
         return((HostName.GetHashCode() * 397) ^ Port);
     }
 }
Beispiel #6
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (BlobName != null)
         {
             hashCode = hashCode * 59 + BlobName.GetHashCode();
         }
         if (ContainerName != null)
         {
             hashCode = hashCode * 59 + ContainerName.GetHashCode();
         }
         if (CorrelationId != null)
         {
             hashCode = hashCode * 59 + CorrelationId.GetHashCode();
         }
         if (HostName != null)
         {
             hashCode = hashCode * 59 + HostName.GetHashCode();
         }
         if (SasToken != null)
         {
             hashCode = hashCode * 59 + SasToken.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #7
0
        public override int GetHashCode()
        {
            int hash = 0x2367589;

            hash ^= HostName.GetHashCode();
            hash ^= Port.GetHashCode();
            return(hash);
        }
Beispiel #8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = HostName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Password?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)AuthenticationType;
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = HostName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (UserName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Password?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Beispiel #10
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (LogicalName != null ? LogicalName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HostName != null ? HostName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ HostGuid.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #11
0
        /// <summary>
        /// Override of the get hash code method.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            //Get hash code for the nullable fields.
            int hashHostName  = HostName == null ? 0 : HostName.GetHashCode();
            int hashPublicUri = PublicUri == null ? 0 : PublicUri.GetHashCode();
            int hashHubs      = Hubs == null ? 0 : Hubs.Distinct().Aggregate(0, (x, y) => x.GetHashCode() ^ y.GetHashCode());;

            //Calculate the hash code for the GPOPolicy.
            return(StartedAt.GetHashCode() ^ hashHostName ^ hashPublicUri ^ hashHubs);
        }
Beispiel #12
0
        public override int GetHashCode()
        {
            int hashCode = (HostName != null ? HostName.GetHashCode() : 0);

            hashCode = (hashCode * 397) ^ (VirtualHost != null ? VirtualHost.GetHashCode() : 0);
            hashCode = (hashCode * 397) ^ Port;
            hashCode = (hashCode * 397) ^ (Username != null ? Username.GetHashCode() : 0);
            hashCode = (hashCode * 397) ^ (Password != null ? Password.GetHashCode() : 0);
            return(hashCode);
        }
        /// <summary>
        /// Returns hash code
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int result = HostName.GetHashCode();

            foreach (var address in AddressList)
            {
                result = (result * 31) ^ address.GetHashCode();
            }
            result ^= Interface.GetHashCode();
            return(result);
        }
Beispiel #14
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Scope != null ? Scope.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ServiceName != null ? ServiceName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HostName != null ? HostName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Port;
         return(hashCode);
     }
 }
Beispiel #15
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>A hash code for the current <see cref="T:System.Object"/>.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = Address.GetHashCode();
         result = (result * 397) ^ HostName.GetHashCode();
         result = (result * 397) ^ ServiceType.GetHashCode();
         result = (result * 397) ^ Port;
         return(result);
     }
 }
Beispiel #16
0
 public override int GetHashCode()
 {
     unchecked
     {
         var result = DataServiceName.GetHashCode();
         result = (result * 397) ^ Name.GetHashCode();
         result = (result * 397) ^ WebRootPath.GetHashCode();
         result = (result * 397) ^ HostName.GetHashCode();
         result = (result * 397) ^ Credentials.GetHashCode();
         return(result);
     }
 }
Beispiel #17
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TimeStamp != 0L)
            {
                hash ^= TimeStamp.GetHashCode();
            }
            if (HostName.Length != 0)
            {
                hash ^= HostName.GetHashCode();
            }
            if (ServiceType != 0)
            {
                hash ^= ServiceType.GetHashCode();
            }
            if (Developer != 0)
            {
                hash ^= Developer.GetHashCode();
            }
            if (ClientIp.Length != 0)
            {
                hash ^= ClientIp.GetHashCode();
            }
            if (Stack.Length != 0)
            {
                hash ^= Stack.GetHashCode();
            }
            if (Message.Length != 0)
            {
                hash ^= Message.GetHashCode();
            }
            if (Action.Length != 0)
            {
                hash ^= Action.GetHashCode();
            }
            if (AccountId.Length != 0)
            {
                hash ^= AccountId.GetHashCode();
            }
            if (ProjectId.Length != 0)
            {
                hash ^= ProjectId.GetHashCode();
            }
            if (Level != 0)
            {
                hash ^= Level.GetHashCode();
            }
            hash ^= Extras.GetHashCode();
            return(hash);
        }
Beispiel #18
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (HostName.Length != 0)
            {
                hash ^= HostName.GetHashCode();
            }
            hash ^= ips_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #19
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = EntryAssemblyName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (EntryAssemblyVersion?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (HostName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (LocalTimeString?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MachineName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (OperatingSystem?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (OperatingSystemVersion?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProcessName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProcessorCount?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
        // Source: http://stackoverflow.com/questions/70303/how-do-you-implement-gethashcode-for-structure-with-two-string#21604191
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = 0;

                // String properties
                hashCode = (hashCode * 397) ^ (HostName != null ? HostName.GetHashCode() : string.Empty.GetHashCode());
                hashCode = (hashCode * 397) ^ (RootRelativeUrl != null ? RootRelativeUrl.GetHashCode() : string.Empty.GetHashCode());

                //// int properties
                //hashCode = (hashCode * 397) ^ intProperty;

                return(hashCode);
            }
        }
Beispiel #21
0
 public override int GetHashCode() {
   int hash = 1;
   if (HostName.Length != 0) hash ^= HostName.GetHashCode();
   if (HostIp.Length != 0) hash ^= HostIp.GetHashCode();
   if (ProcessId != 0) hash ^= ProcessId.GetHashCode();
   if (NodeName.Length != 0) hash ^= NodeName.GetHashCode();
   if (NodeId != 0UL) hash ^= NodeId.GetHashCode();
   if (ChannelName.Length != 0) hash ^= ChannelName.GetHashCode();
   if (ChannelId != 0UL) hash ^= ChannelId.GetHashCode();
   if (MessageType.Length != 0) hash ^= MessageType.GetHashCode();
   if (ProtoDesc.Length != 0) hash ^= ProtoDesc.GetHashCode();
   if (Id != 0UL) hash ^= Id.GetHashCode();
   if (qosProfile_ != null) hash ^= QosProfile.GetHashCode();
   if (socketAddr_ != null) hash ^= SocketAddr.GetHashCode();
   if (ServiceName.Length != 0) hash ^= ServiceName.GetHashCode();
   if (ServiceId != 0UL) hash ^= ServiceId.GetHashCode();
   return hash;
 }
Beispiel #22
0
        public override int GetHashCode()
        {
            // See: http://stackoverflow.com/a/263416/19818
            const int BASE  = 151;
            const int mixer = 2011;

            unchecked // Overflow is fine
            {
                int hash = BASE;
                hash = hash * mixer + HttpPort.GetHashCode();
                if (HostName != null)
                {
                    hash = hash * mixer + HostName.GetHashCode();
                }

                return(hash);
            }
        }
Beispiel #23
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (HostName.Length != 0)
            {
                hash ^= HostName.GetHashCode();
            }
            if (Pid != 0)
            {
                hash ^= Pid.GetHashCode();
            }
            if (startTimestamp_ != null)
            {
                hash ^= StartTimestamp.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #24
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ProtocolVersion != 0)
            {
                hash ^= ProtocolVersion.GetHashCode();
            }
            if (SpawnCount != 0)
            {
                hash ^= SpawnCount.GetHashCode();
            }
            if (ClientDllMd5.Length != 0)
            {
                hash ^= ClientDllMd5.GetHashCode();
            }
            if (MaxClients != 0)
            {
                hash ^= MaxClients.GetHashCode();
            }
            if (GameName.Length != 0)
            {
                hash ^= GameName.GetHashCode();
            }
            if (HostName.Length != 0)
            {
                hash ^= HostName.GetHashCode();
            }
            if (GameInfo.Length != 0)
            {
                hash ^= GameInfo.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #25
0
 /// <summary>Serves as a hash function for a particular type.</summary>
 /// <returns>A hash code for the current Object.</returns>
 public override int GetHashCode()
 {
     return(null != HostName?HostName.GetHashCode() : 0);
 }
Beispiel #26
0
 public override int GetHashCode() => HostName.GetHashCode();
Beispiel #27
0
 public override int GetHashCode()
 => ItemNameDisplay.GetHashCode() +
 HostName.GetHashCode() +
 IpAddress.GetHashCode();
 /// <summary>
 /// Implementation of hash code depending on protocol, hostname and port,
 /// to line up with the implementation of <see cref="Equals"/>.
 /// </summary>
 public override int GetHashCode()
 {
     return(HostName.GetHashCode() ^ Port);
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ProviderName != null)
         {
             hashCode = hashCode * 59 + ProviderName.GetHashCode();
         }
         if (HostName != null)
         {
             hashCode = hashCode * 59 + HostName.GetHashCode();
         }
         if (HostPort != null)
         {
             hashCode = hashCode * 59 + HostPort.GetHashCode();
         }
         if (HostSsl != null)
         {
             hashCode = hashCode * 59 + HostSsl.GetHashCode();
         }
         if (HostTls != null)
         {
             hashCode = hashCode * 59 + HostTls.GetHashCode();
         }
         if (HostNoCertCheck != null)
         {
             hashCode = hashCode * 59 + HostNoCertCheck.GetHashCode();
         }
         if (BindDn != null)
         {
             hashCode = hashCode * 59 + BindDn.GetHashCode();
         }
         if (BindPassword != null)
         {
             hashCode = hashCode * 59 + BindPassword.GetHashCode();
         }
         if (SearchTimeout != null)
         {
             hashCode = hashCode * 59 + SearchTimeout.GetHashCode();
         }
         if (AdminPoolMaxActive != null)
         {
             hashCode = hashCode * 59 + AdminPoolMaxActive.GetHashCode();
         }
         if (AdminPoolLookupOnValidate != null)
         {
             hashCode = hashCode * 59 + AdminPoolLookupOnValidate.GetHashCode();
         }
         if (UserPoolMaxActive != null)
         {
             hashCode = hashCode * 59 + UserPoolMaxActive.GetHashCode();
         }
         if (UserPoolLookupOnValidate != null)
         {
             hashCode = hashCode * 59 + UserPoolLookupOnValidate.GetHashCode();
         }
         if (UserBaseDN != null)
         {
             hashCode = hashCode * 59 + UserBaseDN.GetHashCode();
         }
         if (UserObjectclass != null)
         {
             hashCode = hashCode * 59 + UserObjectclass.GetHashCode();
         }
         if (UserIdAttribute != null)
         {
             hashCode = hashCode * 59 + UserIdAttribute.GetHashCode();
         }
         if (UserExtraFilter != null)
         {
             hashCode = hashCode * 59 + UserExtraFilter.GetHashCode();
         }
         if (UserMakeDnPath != null)
         {
             hashCode = hashCode * 59 + UserMakeDnPath.GetHashCode();
         }
         if (GroupBaseDN != null)
         {
             hashCode = hashCode * 59 + GroupBaseDN.GetHashCode();
         }
         if (GroupObjectclass != null)
         {
             hashCode = hashCode * 59 + GroupObjectclass.GetHashCode();
         }
         if (GroupNameAttribute != null)
         {
             hashCode = hashCode * 59 + GroupNameAttribute.GetHashCode();
         }
         if (GroupExtraFilter != null)
         {
             hashCode = hashCode * 59 + GroupExtraFilter.GetHashCode();
         }
         if (GroupMakeDnPath != null)
         {
             hashCode = hashCode * 59 + GroupMakeDnPath.GetHashCode();
         }
         if (GroupMemberAttribute != null)
         {
             hashCode = hashCode * 59 + GroupMemberAttribute.GetHashCode();
         }
         if (UseUidForExtId != null)
         {
             hashCode = hashCode * 59 + UseUidForExtId.GetHashCode();
         }
         if (Customattributes != null)
         {
             hashCode = hashCode * 59 + Customattributes.GetHashCode();
         }
         return(hashCode);
     }
 }