IsMultiValue() static private method

static private IsMultiValue ( string headerName, bool response ) : bool
headerName string
response bool
return bool
Exemplo n.º 1
0
 internal void InternalSet(string name, string value, bool response)
 {
     value = WebHeaderCollection.checkValue(value);
     if (!WebHeaderCollection.IsMultiValue(name, response))
     {
         base.Set(name, value);
     }
     else
     {
         base.Add(name, value);
     }
 }
        internal string ToStringMultiValue(bool response)
        {
            StringBuilder sb = new StringBuilder();

            this.Count.Times(delegate(int i)
            {
                string key = this.GetKey(i);
                if (WebHeaderCollection.IsMultiValue(key, response))
                {
                    foreach (string arg in this.GetValues(i))
                    {
                        sb.AppendFormat("{0}: {1}\r\n", key, arg);
                    }
                }
                else
                {
                    sb.AppendFormat("{0}: {1}\r\n", key, this.Get(i));
                }
            });
            return(sb.Append("\r\n").ToString());
        }
Exemplo n.º 3
0
        internal string ToStringMultiValue(bool response)
        {
            StringBuilder stringBuilder = new StringBuilder();

            this.Count.Times((int i) => {
                string key = this.GetKey(i);
                if (!WebHeaderCollection.IsMultiValue(key, response))
                {
                    stringBuilder.AppendFormat("{0}: {1}\r\n", key, this.Get(i));
                }
                else
                {
                    string[] values = this.GetValues(i);
                    for (int num = 0; num < (int)values.Length; num++)
                    {
                        string str = values[num];
                        stringBuilder.AppendFormat("{0}: {1}\r\n", key, str);
                    }
                }
            });
            return(stringBuilder.Append("\r\n").ToString());
        }