/*
         * Construct header value string
         */
        internal String ToHeaderString()
        {
            StringBuilder s;
            Object        item;
            int           i, n;

            if (_varyStar)
            {
                return("*");
            }
            else if (_headers != null)
            {
                s = new StringBuilder();

                for (i = 0, n = _headers.Size; i < n; i++)
                {
                    item = _headers.GetValue(i);
                    if (item != null)
                    {
                        HttpCachePolicy.AppendValueToHeader(s, (String)item);
                    }
                }

                if (s.Length > 0)
                {
                    return(s.ToString());
                }
            }

            return(null);
        }
示例#2
0
 internal string ToHeaderString()
 {
     if (this._varyStar)
     {
         return("*");
     }
     if (this._headers != null)
     {
         StringBuilder s     = new StringBuilder();
         int           index = 0;
         int           size  = this._headers.Size;
         while (index < size)
         {
             object obj2 = this._headers.GetValue(index);
             if (obj2 != null)
             {
                 HttpCachePolicy.AppendValueToHeader(s, (string)obj2);
             }
             index++;
         }
         if (s.Length > 0)
         {
             return(s.ToString());
         }
     }
     return(null);
 }