示例#1
0
 void OnMessage(TickerMessage message)
 {
     lock (messagelock)
     {
         messages.Add(new TickerHttpMessage
         {
             Message   = message,
             Timestamp = DateTime.Now,
             Decay     = 60.0
         });
     }
 }
示例#2
0
        void ITimerService.Process(double time)
        {
            lock (sourcelock) {
                if (sources.Count == 0)
                {
                    return;
                }

                index = (index + 1) % sources.Count;

                try {
                    TickerMessage message = sources[index].GenerateTickerMessage();
                    if (message != null)
                    {
                        Message?.Invoke(message);
                    }
                }
                catch (Exception e) {
                    Logger.Error(this, "Error displaying ticker message", e);
                }
            }
        }