From 6c3be1884a780b97fc27df3bf7ff778836798cba Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 15 May 2018 13:29:38 -0400 Subject: [PATCH] feat: Adding constructors to IcdUriBuilder --- ICD.Common.Utils/IcdUriBuilder.cs | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/ICD.Common.Utils/IcdUriBuilder.cs b/ICD.Common.Utils/IcdUriBuilder.cs index b58642a..76d9230 100644 --- a/ICD.Common.Utils/IcdUriBuilder.cs +++ b/ICD.Common.Utils/IcdUriBuilder.cs @@ -1,5 +1,6 @@ using System; using System.Text; +using ICD.Common.Utils.Extensions; namespace ICD.Common.Utils { @@ -57,6 +58,38 @@ namespace ICD.Common.Utils #endregion + /// + /// Constructor. + /// + public IcdUriBuilder() + { + } + + /// + /// Constructor. + /// + /// + public IcdUriBuilder(string uri) + : this(new Uri(uri)) + { + } + + /// + /// Constructor. + /// + /// + public IcdUriBuilder(Uri uri) + { + Fragment = uri.Fragment; + Host = uri.Host; + Password = uri.GetPassword(); + Path = uri.AbsolutePath; + Port = (ushort)uri.Port; + Query = uri.Query; + Scheme = uri.Scheme; + UserName = uri.GetUserName(); + } + /// /// Builds the string representation for the URI. ///