int IComparable.CompareTo(object obj) { if (obj is Student) { return(Surname.CompareTo((obj as Student).Surname)); } throw new NotImplementedException(); }
public int CompareTo(Module other) { if (other == null) { return(1); } if (Name == other.Name) { return(0 - Surname.CompareTo(other.Surname)); } return(0 - Name.CompareTo(other.Name)); }
public int CompareTo(ContactData other) { if (Object.ReferenceEquals(other, null)) { return(1); } if (Surname.CompareTo(other.Surname) != 0) { return(Surname.CompareTo(other.Surname)); } return(Name.CompareTo(other.Name)); }
public int CompareTo(Doctor other) { if (Name.CompareTo(other.Name) != 0) { return(1); } else if (Surname.CompareTo(other.Surname) != 0) { return(1); } return(0); }
public int CompareTo(Residents nextResident) { if (nextResident == null) { return(1); } if (Name == nextResident.Name) { return(Surname.CompareTo(nextResident.Surname)); } else { return(Name.CompareTo(nextResident.Name)); } }
public int CompareTo(object o) { if (o == null) { return(1); } if (o is StudentBSUIR p) { return(Surname.CompareTo(p.Surname)); } else { throw new Exception("Невозможно сравнить два объекта"); } }
public int CompareTo(ContactData other) { if (Object.ReferenceEquals(other, null)) { return(1); } int compareResult = Surname.CompareTo(other.Surname); if (compareResult == 0) { return(Name.CompareTo(other.Name)); } return(compareResult); }
public int CompareTo(ContactData other) { if (Object.ReferenceEquals(other, null)) { return(1); } int temp = Surname.CompareTo(other.Surname); if (temp == 0) { return(Name.CompareTo(other.Name)); } else { return(temp); } }
public int CompareTo(Student anotherStudent) { if (anotherStudent == null) { return(-1); } else { int cmpSurname = Surname.CompareTo(anotherStudent.Surname); if (cmpSurname == 0) { int cmpFirstname = FirstName.CompareTo(anotherStudent.FirstName); return(cmpFirstname != 0 ? cmpFirstname : ID.CompareTo(anotherStudent.ID)); } else { return(cmpSurname); } } }
public int CompareTo(Person other) { return(Surname.CompareTo(other.Surname)); }
/// <summary> /// Checks if a player object comes before, after or at the same position as the other object /// when sorting /// </summary> /// <param name="other">other player to compare to</param> /// <returns>negative number if this player's sorting order if before another object, /// 0 if this player's sorting order is the same as the other player's, /// positive number if this player's sorting order is after the other player's</returns> public int CompareTo(Player other) { return(Surname.CompareTo(other.Surname) == 0 ? Name.CompareTo(other.Name) : Surname.CompareTo(other.Surname)); }
//для сортировки по фамилии public int CompareTo(Visitor obj) { return(Surname.CompareTo(obj.Surname)); }
public int CompareTo(object obj) { Employee tmp = (Employee)obj; return(Surname.CompareTo(tmp.Surname)); }
public int CompareTo(Employee obj) { return(Surname.CompareTo(obj.Surname)); }