public int CompareTo(Time other) { if (Hours != other.Hours) { return(Hours.CompareTo(other.Hours)); } if (Minutes != other.Minutes) { return(Minutes.CompareTo(other.Minutes)); } return(Seconds.CompareTo(other.Seconds)); }
public int CompareTo(TimeOfDay other) { var hoursComparison = Hours.CompareTo(other.Hours); if (hoursComparison != 0) { return(hoursComparison); } var minutesComparison = Minutes.CompareTo(other.Minutes); if (minutesComparison != 0) { return(minutesComparison); } return(Seconds.CompareTo(other.Seconds)); }
public int CompareTo(TimeEntry other) { if (other.Hours == Hours) { if (other.Minutes == Minutes) { if (other.Seconds != 0 && Seconds != 0) return Seconds.CompareTo(other.Seconds); if (other.Decimals != 0 && Decimals != 0) return Decimals.CompareTo(other.Decimals); return GetSecondsDecimal().CompareTo(other.GetSecondsDecimal()); } return Minutes.CompareTo(other.Minutes); } return Hours.CompareTo(other.Hours); }
public int CompareTo(Time other) { int compare = Hours.CompareTo(other.Hours); if (compare != 0) { return(compare); } compare = Minutes.CompareTo(other.Minutes); if (compare != 0) { return(compare); } compare = Seconds.CompareTo(other.Seconds); if (compare != 0) { return(compare); } return(MiliSeconds.CompareTo(other.MiliSeconds)); }