Example #1
0
        internal HttpHeadersDetail Clone()
        {
            HttpHeadersDetail cloned = new HttpHeadersDetail();

            cloned.m_headers = new NameValueCollection(m_headers);
            return(cloned);
        }
Example #2
0
        public override MemberWrappers GetMembers()
        {
            HttpHeadersDetail headers = (HttpHeadersDetail)GetWrappedObject();
            MemberWrappers    members = new MemberWrappers();

            for (int index = 0; index < headers.Count; ++index)
            {
                members.Add(new ConstantMemberWrapper(headers.GetKey(index), headers.GetValue(index)));
            }

            return(members);
        }
Example #3
0
        public override bool Equals(object obj)
        {
            HttpHeadersDetail other = obj as HttpHeadersDetail;

            if (other == null || m_headers.Count != other.m_headers.Count)
            {
                return(false);
            }

            for (int index = 0; index < m_headers.Count; ++index)
            {
                string key      = m_headers.GetKey(index);
                string otherKey = other.m_headers.GetKey(index);
                if (key != otherKey)
                {
                    return(false);
                }

                string[] values      = m_headers.GetValues(index);
                string[] otherValues = other.m_headers.GetValues(index);

                if (values == null)
                {
                    if (otherValues != null)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (otherValues == null)
                    {
                        return(false);
                    }

                    if (values.Length != otherValues.Length)
                    {
                        return(false);
                    }

                    for (int valueIndex = 0; valueIndex < values.Length; ++valueIndex)
                    {
                        if (values[valueIndex] != otherValues[valueIndex])
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
Example #4
0
 internal HttpHeadersGenericWrapper(HttpHeadersDetail value)
     : base(value)
 {
 }
Example #5
0
 internal HttpHeadersMemberWrapper(HttpHeadersDetail value)
 {
     m_value = value;
 }