Beispiel #1
0
        public int CompareTo(ContactData other)
        {
            if (Object.ReferenceEquals(other, null))
            {
                return(1);
            }

            if (SecondName == other.SecondName)
            {
                if (FirstName == other.FirstName)
                {
                    return(0);
                }
                return(SecondName.CompareTo(other.SecondName));
            }
            return(SecondName.CompareTo(other.SecondName));
        }
        public int CompareTo(ContactData other)
        {
            if (Object.ReferenceEquals(other, null))
            {
                return(1);
            }
            int result = SecondName.CompareTo(other.SecondName);

            if (result != 0)
            {
                return(result);
            }
            else
            {
                return(FirstName.CompareTo(other.FirstName));
            }
        }
Beispiel #3
0
 public int CompareTo(object obj)
 {
     return(SecondName.CompareTo(((Person)obj).SecondName));
 }
Beispiel #4
0
 /// <summary>
 /// Реализация интерфейса IComparable по полю фамилия
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int CompareTo(object obj)
 {
     return(SecondName.CompareTo(obj));
 }