public int CompareTo(Rule other) { if (other == null) { return(1); } int result = Target.CompareTo(other.Target); if (result != 0) { return(result); } return(Chains.SequenceCompare(other.Chains)); }