コード例 #1
0
        public int CompareTo(object obj)
        {
            TaskOccurrence otherOccurrence = obj as TaskOccurrence;

            if (otherOccurrence == null)
            {
                throw new InvalidOperationException("Cannot compare to something that is not of the same type");
            }

            return(this.OccurrenceMoment.CompareTo(otherOccurrence.OccurrenceMoment));
        }
コード例 #2
0
        private DateTime GetLastTimeTaskWasPerformed()
        {
            TaskOccurrence lastOccurence = this.taskOccurrences.LastOrDefault();

            if (lastOccurence != null)
            {
                return(lastOccurence.OccurrenceMoment);
            }
            else
            {
                return(default(DateTime));
            }
        }