public int CompareTo(object obj) { var other = obj as IPAddress; if (other != null) { return(AddressAsDecimal.CompareTo(other.AddressAsDecimal)); } else { return(1); } }