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_)); }
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); }