Comparison Members

Generates a CompareTo implementation and optionally implements the IComparable<T> and IComparable interfaces.

Selectable items: members to compare on objects’ comparison.

Options:

  • Implement IComparable<T> and IComparable interfaces — adds interfaces implementation to the target type.
  • Overload relational members — implements the overloads of the “>“, “<“, “>=“ and “<=“ operators to call the custom CompareTo method.

Example

The screencast below shows how to use the Comparison Members action in the Declare Menu.

Compare