public BeatPulseContext AddTracker(IBeatPulseTrackerRegistration registration) { if (registration == null) { throw new ArgumentNullException(nameof(registration)); } _activeTrackers.Add(registration); return(this); }
public BeatPulseContext AddTracker(IBeatPulseTrackerRegistration registration) { if (registration == null) { throw new ArgumentNullException(nameof(registration)); } var name = registration.Name; if (!_activeTrackers.ContainsKey(name)) { _activeTrackers.Add(name, registration); } else { throw new InvalidOperationException($"The tracker {registration.Name} is already registered."); } return(this); }