コード例 #1
0
        private void despacharEventosLOF(object sender, HBLivroOfertasEventArgs args)
        {
            try
            {
                string mensagem = null;

                EventoHBLivroOfertas eventoHB = args.Evento;
                mensagem = eventoHB.mensagem;

                if (!String.IsNullOrEmpty(mensagem))
                {
                    bool sinaliza = queueToHomeBroker.IsEmpty;
                    queueToHomeBroker.Enqueue(mensagem);
                    if (sinaliza)
                    {
                        lock (syncObj)
                        {
                            Monitor.Pulse(syncObj);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("despacharEventosLOF(): " + ex.Message, ex);
            }
        }
コード例 #2
0
 public void SendEvent(EventoHBLivroOfertas e)
 {
     try
     {
         //bool bsinaliza = queueHBLOF.IsEmpty;
         queueHBLOF.Enqueue(e);
         //if (bsinaliza)
         //{
         //    lock (syncQueueHBLOF)
         //    {
         //        Monitor.Pulse(syncQueueHBLOF);
         //    }
         //}
     }
     catch (Exception ex)
     {
         logger.Error("SendEvent(EventoHBLivroOfertas): " + ex.Message, ex);
     }
 }