示例#1
0
        public List <CallLogModel> GetCallsHistory()
        {
            _history = new List <CallLogModel>();

            if (Core.CallLogs != null)
            {
                foreach (CallLog log in Core.CallLogs)
                {
                    string from = log.FromAddress.DisplayName;
                    if (from == null || from.Length == 0)
                    {
                        Address fromAddress = log.FromAddress;
                        from = fromAddress.AsStringUriOnly();
                    }

                    string to = log.ToAddress.DisplayName;
                    if (to == null || to.Length == 0)
                    {
                        Address toAddress = log.ToAddress;
                        to = toAddress.AsStringUriOnly();
                    }

                    bool         isMissed  = log.Status == CallStatus.Missed;
                    long         startDate = log.StartDate;
                    CallLogModel callLog   = new CallLogModel(log, from, to, log.Dir == CallDir.Incoming, isMissed, startDate);
                    _history.Add(callLog);
                }
            }

            return(_history);
        }
示例#2
0
 public void RemoveCallLogs(IEnumerable <CallLogModel> logsToRemove)
 {
     for (int i = 0; i < logsToRemove.Count(); i++)
     {
         CallLogModel logToRemove = logsToRemove.ElementAt(i);
         Core.RemoveCallLog(logToRemove.NativeLog as CallLog);
     }
 }