示例#1
0
        private static void Service_MessageReceived(object sender, MessageReceivedEventArgs e)
        {
            if (e.IsUserMessage)
            {
                Console.WriteLine($"[*] {e.UsrMessage.User}: {e.UsrMessage.Message}");
            }
            //else
            Console.WriteLine($"[*] {e.ToString()}");

            if (e.FromSystemFormat.Contains("366", StringComparison.OrdinalIgnoreCase))
            {
                connected = true;
                Console.WriteLine("[*] Connected");
            }
        }
示例#2
0
        public void OnReceiveMessage(MessageReceivedEventArgs e)
        {
            DateTime     dt   = DateTime.Now;
            ListViewItem item = new ListViewItem(e.ToString());

            item.Tag = e.Message;

            if (m_wndListView.Items.Count > 0)
            {
                m_wndListView.Items.Insert(0, item);
            }
            else
            {
                m_wndListView.Items.Add(item);
            }

            CTrapInstance trap = CTrapInstance.FromMessage(
                e.Message,
                CBaseTypesAlarmes.Instance.BaseTraps);

            if (trap != null)
            {
                IEnumerable <CTrapHandler> lstTrapsHandlers = CBaseTypesAlarmes.Instance.BaseTraps.GetTrapsHandlersAAppliquer(trap);

                foreach (CTrapHandler handler in lstTrapsHandlers)
                {
                    handler.CreateAlarmesOnTrap(trap);
                }
                foreach (CAlarmeACreer creation in trap.AlarmesACreer)
                {
                    m_gestionnaireAlarmes.CreateAlarme(creation);
                }

                TimeSpan sp = DateTime.Now - dt;
                System.Console.WriteLine("Durée traitement : " + sp.TotalMilliseconds.ToString());
                RefreshListeAlarmes();
            }
        }
示例#3
0
 void CaptureInterface_RemoteMessage(MessageReceivedEventArgs message)
 {
     MessageBox.Show(message.ToString());
 }