Example #1
0
        public int CompareTo(object obj)
        {
            Call anotherCall = obj as Call;

            if (anotherCall == null)
            {
                throw new InvalidOperationException($"{nameof(anotherCall)} must not be null");
            }
            if (CallTime.Count == 0 || anotherCall?.CallTime.Count == 0)
            {
                throw new InvalidOperationException($"{nameof(CallTime)} must not be empty");
            }

            return(CallTime.Last().Time.CompareTo(anotherCall.CallTime.Last().Time));
        }
Example #2
0
 public Call(Contact contact, string number, DateTime time, bool isIncoming)
 {
     this.contact = contact;
     CallTime.Add(new CallTime(number, time));
     IsIncoming = isIncoming;
 }