private void HandleTrackEvent(object sender, TrackDataEventArgs e) { Console.ClearConsole(); OccurrenceTracks.Clear(); try { if (e.TrackData == null) { throw new NullReferenceException("empty Track list"); } var listOfTracks = e.TrackData; foreach (var track in listOfTracks) { Formatter.FormatTracks(track, Tracks); Detector.CheckOccurrence(track, Tracks); } Display.RenderOccurences(OccurrenceTracks); Display.RenderTrack(Tracks); } catch (NullReferenceException ex) { Exception.Handle(ex); } }
private void HandleOccurenceEvent(object sender, OccurrenceEventArgs e) { ObservedTrack = e.ObservedTrack; OccurenceTrack = e.OccurenceTrack; OccurrenceTime = e.OccurenceTime; OccurrenceTracks.Add(Formatter.FormatOccurence(ObservedTrack, OccurenceTrack, OccurrenceTime)); // Log occurence Logger.LogOccurrences(ObservedTrack, OccurenceTrack, OccurrenceTime); }