Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UriFormatter"/> class with
        /// the specified <see cref="Uri"/>.
        /// </summary>
        /// <param name="uri">The <see cref="Uri"/> to assign.</param>
        public UriFormatter(UriFormatter uri)
        {
            Guard.ArgumentNotNull(uri, "uri");

            _uri = uri._uri;
            _requiresParseUri   = uri._requiresParseUri;
            _requiresRebuildUri = uri._requiresRebuildUri;

            _scheme   = uri._scheme;
            _port     = uri._port;
            _host     = uri._host;
            _fragment = uri._fragment;

            _pathInternal        = uri._pathInternal;
            _directPath          = uri._directPath;
            _requiresParsePath   = uri._requiresParsePath;
            _requiresRebuildPath = uri._requiresRebuildPath;

            if (uri._pathSegments != null)
            {
                _pathSegments = new List <UriPathSegment>(uri._pathSegments.Count);

                foreach (var segment in uri._pathSegments)
                {
                    var clone = new UriPathSegment(segment)
                    {
                        Formatter = this
                    };
                    _pathSegments.Add(clone);
                }
            }

            _query = uri._query;
            _requiresParseQuery   = uri._requiresParseQuery;
            _requiresRebuildQuery = uri._requiresRebuildQuery;

            if (uri._queryArgs != null)
            {
                _queryArgs = new QueryArgsDictionary(this, uri._queryArgs);
            }
        }
Ejemplo n.º 2
0
 public QueryArgsDictionary(UriFormatter uri)
     : base(StringComparer.OrdinalIgnoreCase)
 {
     _uri = uri;
 }
Ejemplo n.º 3
0
 public QueryArgsDictionary(UriFormatter uri, IDictionary <string, string> items)
     : base(items, StringComparer.OrdinalIgnoreCase)
 {
     _uri = uri;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SDataUri"/> class with
 /// the specified <see cref="Uri"/>.
 /// </summary>
 /// <param name="uri">The <see cref="Uri"/> to assign.</param>
 public SDataUri(UriFormatter uri)
     : base(uri)
 {
 }