Esempio n. 1
0
 public int CompareTo(BillTracker other)
 {
     if (other == null)
     {
         return(1);
     }
     else
     {
         return(CompanyName.CompareTo(other.CompanyName));
     }
 }
        public int CompareTo(Object obj) //implementation of CompareTo
        {                                // for IComparable
            Company other = (Company)obj;

            return(CompanyName.CompareTo(other.CompanyName)); //uses CompanyName for comparison
        }