Exemple #1
0
        public void DeleteLongestCall()
        {
            ulong longestCallDuration = 0;
            Call longestCall = new Call();

            foreach (var item in this.CallHistory)
            {
                if (item.Duration >= longestCallDuration)
                {
                    longestCall = item;
                }
            }

            this.DeleteCallFromHistory(longestCall);
        }
Exemple #2
0
 public virtual void AddCallToHistory(string date, string time, string dialedPhone, ulong duration)
 {
     Call call = new Call(date, time, dialedPhone, duration);
     callHistory.Add(call);
 }
Exemple #3
0
 public bool DeleteCallFromHistory(Call call)
 {
     for (int i = 0; i < callHistory.Count; i++)
     {
         if (callHistory[i].Date == call.Date &&
             callHistory[i].Time == call.Time &&
             callHistory[i].DialedPhone == call.DialedPhone &&
             callHistory[i].Duration == call.Duration)
         {
             callHistory.RemoveAt(i);
             return true;
         }
     }
     return false;
 }
Exemple #4
0
 public void AddCall(Call call)
 {
     CallHistory.Add(call);
 }