Exemplo n.º 1
0
        internal bool IsEquivalent(AddressHeaderCollection col)
        {
            if (this.InternalCount != col.InternalCount)
            {
                return(false);
            }
            StringBuilder            builder = new StringBuilder();
            Dictionary <string, int> headers = new Dictionary <string, int>();

            this.PopulateHeaderDictionary(builder, headers);
            Dictionary <string, int> dictionary2 = new Dictionary <string, int>();

            col.PopulateHeaderDictionary(builder, dictionary2);
            if (headers.Count != dictionary2.Count)
            {
                return(false);
            }
            foreach (KeyValuePair <string, int> pair in headers)
            {
                int num;
                if (dictionary2.TryGetValue(pair.Key, out num))
                {
                    if (num != pair.Value)
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        internal bool IsEquivalent(AddressHeaderCollection col)
        {
            if (InternalCount != col.InternalCount)
            {
                return(false);
            }

            StringBuilder            builder   = new StringBuilder();
            Dictionary <string, int> myHeaders = new Dictionary <string, int>();

            PopulateHeaderDictionary(builder, myHeaders);

            Dictionary <string, int> otherHeaders = new Dictionary <string, int>();

            col.PopulateHeaderDictionary(builder, otherHeaders);

            if (myHeaders.Count != otherHeaders.Count)
            {
                return(false);
            }

            foreach (KeyValuePair <string, int> pair in myHeaders)
            {
                int count;
                if (otherHeaders.TryGetValue(pair.Key, out count))
                {
                    if (count != pair.Value)
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }

            return(true);
        }