Example #1
0
        private static NameValueCollection FaultIn(ref NameValueCollection collection)
        {
            if (collection == null)
            {
                collection = new HttpValuesCollection();
            }

            return(collection);
        }
Example #2
0
        private NameValueCollection CopyCollection(HttpCookieCollection cookies)
        {
            if (cookies == null || cookies.Count == 0)
            {
                return(null);
            }

            NameValueCollection copy = new HttpValuesCollection(cookies.Count);

            for (int i = 0; i < cookies.Count; i++)
            {
                HttpCookie cookie = cookies[i];

                //
                // NOTE: We drop the Path and Domain properties of the
                // cookie for sake of simplicity.
                //

                copy.Add(cookie.Name, cookie.Value);
            }

            return(copy);
        }
Example #3
0
        private NameValueCollection CopyCollection(HttpCookieCollection cookies)
        {
            if (cookies == null || cookies.Count == 0)
            {
                return null;
            }

            NameValueCollection copy = new HttpValuesCollection(cookies.Count);

            for (int i = 0; i < cookies.Count; i++)
            {
                HttpCookie cookie = cookies[i];

                //
                // NOTE: We drop the Path and Domain properties of the
                // cookie for sake of simplicity.
                //

                copy.Add(cookie.Name, cookie.Value);
            }

            return copy;
        }
Example #4
0
        private static NameValueCollection FaultIn(ref NameValueCollection collection)
        {
            if (collection == null)
            {
                collection = new HttpValuesCollection();
            }

            return collection;
        }