object ISumable.Sum(object sum) { if (sum is string) { return(sum); } TimeSec sec = (TimeSec)sum; if (sec == Empty) { return(this); } if (this == Empty) { return(sec); } if ((sec == MaxValue) || (this == MaxValue)) { return(MaxValue); } if (!(sec == MinValue) && !(this == MinValue)) { return(sec + this); } return(MinValue); }
static TimeSec() { Empty = new TimeSec(TimeSpan.MinValue); Zero = new TimeSec(TimeSpan.Zero); Midnight = new TimeSec(0x18, 0, 0); MinValue = Empty; MaxValue = new TimeSec(TimeSpan.MaxValue); }