private void RaiseGameEvent(string jsonString) { try { TimeOfLastRadarGameEventOrHeartbeat = DateTime.Now; bool isHeartbeat = jsonString.Contains("heartbeat"); NbaGameEvent mlbGameEvent = null; if (isHeartbeat) { #if DEBUG Logger.Info("Radar heartbeat"); #endif } if (!isHeartbeat) { Logger.Info(jsonString); mlbGameEvent = NbaGameEvent.FromJson(jsonString); } bool isGameEvent = mlbGameEvent != null; if (isGameEvent) { NbaGameEventEventArgs nbaGameEventEventArgs = new NbaGameEventEventArgs { GameEvent = mlbGameEvent }; OnRadarGameEvent(nbaGameEventEventArgs); } } catch (Exception e) { Logger.Info(e); } }
private void OnRadarGameEvent(NbaGameEventEventArgs nbaGameEventEventArgs) { RadarGameEvent?.Invoke(this, nbaGameEventEventArgs); }