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

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

            if (!isHeartbeat)
            {
                mlbGameEvent = MlbGameEvent.FromJson(jsonString);
            }

            bool isGameEvent = mlbGameEvent != null;

            if (isGameEvent)
            {
                MlbGameEventEventArgs mlbGameEventEventArgs = new MlbGameEventEventArgs
                {
                    GameEvent = mlbGameEvent
                };
                OnRadarGameEvent(mlbGameEventEventArgs);
            }
        }
Ejemplo n.º 2
0
 private void OnRadarGameEvent(MlbGameEventEventArgs mlbGameEventEventArgs)
 {
     RadarGameEvent?.Invoke(this, mlbGameEventEventArgs);
 }