Exemplo n.º 1
0
        private void RaiseRadarGameEvent(string jsonString)
        {
            TimeOfLastRadarGameEventOrHeartbeat = DateTime.Now;
            bool         isHeartbeat  = jsonString.Contains("heartbeat");
            NhlGameEvent nhlGameEvent = null;

            if (isHeartbeat)
            {
                Logger.Info("Radar heartbeat");
            }

            if (!isHeartbeat)
            {
                // Logger.Info(jsonString);
                nhlGameEvent = NhlGameEvent.FromJson(jsonString);
            }

            bool isGameEvent = nhlGameEvent != null;

            if (isGameEvent)
            {
                NhlGameEventEventArgs nhlGameEventEventArgs = new NhlGameEventEventArgs
                {
                    GameEvent = nhlGameEvent
                };
                OnRadarGameEvent(nhlGameEventEventArgs);
            }
        }
Exemplo n.º 2
0
 private void OnRadarGameEvent(NhlGameEventEventArgs nhlGameEventEventArgs)
 {
     RadarGameEvent?.Invoke(this, nhlGameEventEventArgs);
 }