Esempio n. 1
0
        public override bool Equals(object obj)
        {
            AddressHeader hdr = obj as AddressHeader;

            if (hdr == null)
            {
                return(false);
            }

            StringBuilder builder = new StringBuilder();
            string        hdr1    = GetComparableForm(builder);

            builder.Remove(0, builder.Length);
            string hdr2 = hdr.GetComparableForm(builder);

            if (hdr1.Length != hdr2.Length)
            {
                return(false);
            }

            if (string.CompareOrdinal(hdr1, hdr2) != 0)
            {
                return(false);
            }

            return(true);
        }
        public override bool Equals(object obj)
        {
            AddressHeader header = obj as AddressHeader;

            if (header == null)
            {
                return(false);
            }
            StringBuilder builder        = new StringBuilder();
            string        comparableForm = this.GetComparableForm(builder);

            builder.Remove(0, builder.Length);
            string strB = header.GetComparableForm(builder);

            if (comparableForm.Length != strB.Length)
            {
                return(false);
            }
            if (string.CompareOrdinal(comparableForm, strB) != 0)
            {
                return(false);
            }
            return(true);
        }