Ejemplo n.º 1
0
        public BeatPulseContext AddTracker(IBeatPulseTrackerRegistration registration)
        {
            if (registration == null)
            {
                throw new ArgumentNullException(nameof(registration));
            }

            _activeTrackers.Add(registration);

            return(this);
        }
Ejemplo n.º 2
0
        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);
        }