Example #1
0
 public DiffComparison Compare (IDiffComparable other)
 {
     var other2 = other as DateHolder;
     if (other2 == null || other2.Date != Date) {
         return DiffComparison.Different;
     } else {
         var same = other2.TotalDuration == TotalDuration && other2.IsRunning == IsRunning;
         return same ? DiffComparison.Same : DiffComparison.SoftUpdate;
     }
 }
Example #2
0
 public DiffComparison Compare (IDiffComparable other)
 {
     if (object.ReferenceEquals (this, other)) {
         return DiffComparison.Same;
     } else {
         var other2 = other as TimeEntryHolder;
         return other2 != null && other2.Data.Id == Data.Id
                ? DiffComparison.Update : DiffComparison.Different;
     }
 }
Example #3
0
 public DiffComparison Compare(IDiffComparable other)
 {
     if (object.ReferenceEquals(this, other))
     {
         return(DiffComparison.Same);
     }
     else
     {
         var other2 = other as TimeEntryHolder;
         return(other2 != null && other2.Data.Id == Data.Id
                ? DiffComparison.Update : DiffComparison.Different);
     }
 }
Example #4
0
        public DiffComparison Compare (IDiffComparable other)
        {
            if (object.ReferenceEquals (this, other)) {
                return DiffComparison.Same;
            } else {
                var other2 = other as TimeEntryGroup;

                // Use the last Id for comparison as this is the original entry
                // (Group is sorted by StartTime in descending order)
                return other2 != null && other2.Group.Last ().Id == Group.Last ().Id
                       ? DiffComparison.Update : DiffComparison.Different;
            }
        }
Example #5
0
        public DiffComparison Compare(IDiffComparable other)
        {
            var other2 = other as DateHolder;

            if (other2 == null || other2.Date != Date)
            {
                return(DiffComparison.Different);
            }
            else
            {
                var same = other2.TotalDuration == TotalDuration && other2.IsRunning == IsRunning;
                return(same ? DiffComparison.Same : DiffComparison.SoftUpdate);
            }
        }
Example #6
0
        public DiffComparison Compare(IDiffComparable other)
        {
            var other2 = other as TimeEntryGroup;

            if (other2 != null)
            {
                if (DataCollection.SequenceEqual(other2.DataCollection, object.ReferenceEquals))
                {
                    return(DiffComparison.Same);
                }
                else
                {
                    return(Data.IsGroupableWith(other2.Data) ?
                           DiffComparison.Update : DiffComparison.Different);
                }
            }
            else
            {
                return(DiffComparison.Different);
            }
        }