示例#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);
     }
 }
示例#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);
             }
         }
     }
 }
示例#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);
            }
        }
示例#4
0
 public void OnMessage(DateTime time, PowerEvent pe)
 {
 }