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"); } }
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(); } }
void CaptureInterface_RemoteMessage(MessageReceivedEventArgs message) { MessageBox.Show(message.ToString()); }