1
0
oop-1-labs/Lab5/Lab5.TouristInformationCenter/LocationsComparatorByNameAddress.cs

18 lines
443 B
C#

namespace Lab5.TouristInformationCenter
{
class LocationsComparatorByNameAddress : LocationsComparator
{
public override int Compare(Location a, Location b)
{
int nameCompare = a.Name.CompareTo(b.Name);
if (nameCompare == 0)
{
return a.Address.CompareTo(b.Address);
} else
{
return nameCompare;
}
}
}
}