/// <summary> /// Create a new instance using an existing URI for defaults. /// </summary> /// <param name="uriString">The URI string.</param> /// <param name="defaultUri">The URI to use for any values that are not specified by uriString.</param> /// <exception cref="UriFormatException">If the URI is not valid.</exception> public ElvinURI(String uriString, ElvinURI defaultUri) { Init(defaultUri); this.UriString = uriString; ParseUri(); Validate(); this.hash = ComputeHash(); }
public bool Equals(ElvinURI uri) { return hash == uri.hash && Scheme == uri.Scheme && Host == uri.Host && Port == uri.Port && VersionMajor == uri.VersionMajor && VersionMinor == uri.VersionMinor && Enumerable.SequenceEqual(Options, uri.Options) && Enumerable.SequenceEqual(Protocol, uri.Protocol); }
protected void Init(ElvinURI defaultUri) { this.UriString = defaultUri.UriString; this.Scheme = defaultUri.Scheme; this.VersionMajor = defaultUri.VersionMajor; this.VersionMinor = defaultUri.VersionMinor; this.Protocol = defaultUri.Protocol; this.Host = defaultUri.Host; this.Port = defaultUri.Port; this.Options = defaultUri.Options; this.hash = defaultUri.hash; }
/// <summary> /// Create a copy of a URI. /// </summary> /// <param name="defaultUri">The URI to copy.</param> public ElvinURI(ElvinURI defaultUri) { Init(defaultUri); Validate(); }