public bool Equals(MapSiteConfig other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(string.Equals(_hostName, other._hostName) && _requestScheme.HasFlag(other._requestScheme)); }
/// <summary> /// Repressents a site map. /// </summary> /// <param name="hostName"> /// The hostname this site map is associated with. Include a port number if non standard port is /// used. For example "example.com:81" /// </param> /// <param name="requestScheme">The request scheme this site responds too.</param> /// <exception cref="ArgumentException"></exception> public MapSiteConfig(string hostName, RequestScheme requestScheme = RequestScheme.Http) { if (string.IsNullOrWhiteSpace(hostName)) { throw new ArgumentException("hostName must not be null or whitespace"); } if (!hostName.Contains(":")) { hostName = hostName + (requestScheme.HasFlag(RequestScheme.Https) ? ":443" : ":80"); } _requestScheme = requestScheme; _hostName = hostName; }