Beispiel #1
0
 public static void Broadcast(IService source, DateTime time, PowerEvent pe)
 {
     foreach (var s in m_Services.Where(s => s != source))
     {
         s.OnMessage(time, pe);
     }
 }
Beispiel #2
0
 public void OnMessage(DateTime time, PowerEvent pe)
 {
     if (pe.IsImportant())
     {
         foreach (long sub in m_Subscribers)
         {
             try
             {
                 Bot.SendTextMessageAsync(sub, $"New event : {pe}");
             }
             catch (Exception ex)
             {
                 Handle(ex);
             }
         }
     }
 }
Beispiel #3
0
        public void OnMessage(DateTime time, PowerEvent pe)
        {
            m_Lines += 1;

            if (pe.Event == EventKind.UnknownError)
            {
                m_Errors += 1;
            }

            string msg = $"{time.ToString("u")} : {pe}";

            File.AppendAllText(GetFile(), $"{msg}\n");

            Console.WriteLine(msg);

            m_Last10Rows.Add(msg);

            if (m_Last10Rows.Count > 10)
            {
                m_Last10Rows.RemoveAt(0);
            }
        }
Beispiel #4
0
 public void OnMessage(DateTime time, PowerEvent pe)
 {
 }