Exemplo n.º 1
0
 private void ServiceNewSmsEvent(object sender, NewMessageEventHandlerArgs e)
 {
     try
     {
         int        index = e.SmsIndex;
         ReceiveSms sms   = _service.GetSms(index);
         _log.InfoFormat("Receive new sms,content:{0},Mobile{1}", sms.Content, sms.SendMobile);
         if (_handler != null)
         {
             if (!_handler.OnReceived(sms))
             {
                 Thread.Sleep(1000);
                 Delete(e.SmsIndex);
             }
         }
     }
     catch (Exception ex)
     {
         _log.Error("Get a new message ,but found the error.", ex);
         Delete(e.SmsIndex);
         throw;
     }
 }
Exemplo n.º 2
0
 public override bool Decode(string receiveName, out ReceiveSms sms)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 public bool OnReceived(ReceiveSms receiveSms)
 {
     log.InfoFormat("{0} {1},{2}", receiveSms.SendMobile, receiveSms.Content, receiveSms.ReceiveTime);
     return(false);
 }
Exemplo n.º 4
0
 /// <summary>
 /// /
 /// </summary>
 /// <param name="receiveName"></param>
 /// <param name="sms"></param>
 /// <returns></returns>
 public abstract bool Decode(string receiveName, out ReceiveSms sms);
Exemplo n.º 5
0
 public override bool Decode(string receiveName, out ReceiveSms sms)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 /// <summary>
 /// /
 /// </summary>
 /// <param name="receiveName"></param>
 /// <param name="sms"></param>
 /// <returns></returns>
 public abstract bool Decode(string receiveName, out ReceiveSms sms);
Exemplo n.º 7
0
 public bool OnReceived(ReceiveSms receiveSms)
 {
     log.InfoFormat("{0} {1},{2}", receiveSms.SendMobile, receiveSms.Content, receiveSms.ReceiveTime);
     return false;
 }