public int CompareTo(object obj) { CTariff trf = obj as CTariff; if (trf != null) { if (this.Time > trf.mdtime) { return(1); } else if (this.Time < trf.mdtime) { return(-1); } else { return(0); } } else { throw new ArgumentException("obj is not a CTariff object"); } }