예제 #1
0
        private void RafraichirListeSms(ReponseCommandeAT reponseAT_CMGL_ALL)
        {
            _listeSms.Clear();
            int  startidx = reponseAT_CMGL_ALL.ReponseCommande.IndexOf("+CMGL:");
            bool stop     = (startidx < 0);

            while (!stop)
            {
                int    endidx = reponseAT_CMGL_ALL.ReponseCommande.IndexOf("\r\n+CMGL:", startidx + 6);
                string unSms;
                if (endidx >= 0)
                {
                    unSms = reponseAT_CMGL_ALL.ReponseCommande.Substring(startidx, endidx - startidx - 2);
                }
                else
                {
                    unSms = reponseAT_CMGL_ALL.ReponseCommande.Substring(startidx);
                    stop  = true;
                }
                SmsVM unSmsViewModel = new SmsVM(unSms);
                _listeSms.Add(unSmsViewModel);
                unSmsViewModel.SurRepondreSms += UnSmsViewModel_SurRepondreSms;
                startidx = endidx + 2;
            }
            OnPropertyChanged("ListeSms");
        }
예제 #2
0
 private async void Modele_SurAjoutSmsDansMemoire(object sender, uint noSms)
 {
     await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
     {
         ReponseCommandeAT smsRecu = await Modele.GetSms(noSms, true);
         if (smsRecu != null)
         {
             SmsVM unSmsViewModel = new SmsVM(smsRecu.ReponseCommande, noSms);
             _listeSms.Add(unSmsViewModel);
             unSmsViewModel.SurRepondreSms += UnSmsViewModel_SurRepondreSms;
             OnPropertyChanged("ListeSms");
         }
     });
 }