public override int GetHashCode() { if (this.m_hashCode == -1) { this.m_hashCode = this.m_connectionSecurity.GetHashCode(); ConnectionKey.HashCombine(ref this.m_hashCode, this.m_impersonateUser.GetHashCode()); if (this.m_dataSourceType != null) { ConnectionKey.HashCombine(ref this.m_hashCode, this.m_dataSourceType.GetHashCode()); } if (this.m_connectionString != null) { ConnectionKey.HashCombine(ref this.m_hashCode, this.m_connectionString.GetHashCode()); } if (this.m_domainName != null) { ConnectionKey.HashCombine(ref this.m_hashCode, this.m_domainName.GetHashCode()); } if (this.m_userName != null) { ConnectionKey.HashCombine(ref this.m_hashCode, this.m_userName.GetHashCode()); } if (this.m_impersonateUserName != null) { ConnectionKey.HashCombine(ref this.m_hashCode, this.m_impersonateUserName.GetHashCode()); } } return(this.m_hashCode); }
public override bool Equals(object obj) { ConnectionKey connectionKey = obj as ConnectionKey; if (connectionKey != null && this.m_dataSourceType == connectionKey.m_dataSourceType && this.m_connectionString == connectionKey.m_connectionString && this.m_connectionSecurity == connectionKey.m_connectionSecurity && this.m_domainName == connectionKey.m_domainName && this.m_userName == connectionKey.m_userName && this.m_impersonateUser == connectionKey.m_impersonateUser && this.m_impersonateUserName == connectionKey.m_impersonateUserName) { return(true); } return(false); }