Пример #1
0
        /// <summary>
        /// Gets or sets a query argument.
        /// </summary>
        /// <param name="name">The name of the argument.</param>
        /// <param name="value">The value of the argument.</param>
        public string this[string name]
        {
            get
            {
                CheckParseUri();

                string value;

                if (QueryArgs.TryGetValue(name, out value))
                {
                    return(value);
                }
                return(null);
            }
            set
            {
                CheckParseUri();

                if (value == null)
                {
                    if (_queryArgs != null && _queryArgs.ContainsKey(name))
                    {
                        _queryArgs.Remove(name);
                    }
                }
                else
                {
                    QueryArgs[name] = value;
                }

                RequiresRebuildUri = true;
            }
        }