Exemplo n.º 1
0
        public int CompareTo(object obj)
        {
            MXRecord mx_other = (MXRecord)obj;

            if (mx_other.preference_ < preference_ || mx_other.preference_ > preference_)
            {
                return(-1);
            }

            // order mail servers of same preference by name
            return(-mx_other.domain_name_.CompareTo(domain_name_));
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            // must be of the same class type
            MXRecord mx_other = obj as MXRecord;

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

            // preference and domain name must match
            if (mx_other.preference_ != preference_ || mx_other.domain_name_ != domain_name_)
            {
                return(false);
            }

            return(true);
        }