/// <summary> /// Add a new scheduled action /// </summary> /// <param name="scheduledaction"></param> public ScheduledEventAction Add(ScheduledEventAction scheduledaction) { lock (_locker) { //Check if already exists if (!_eventActions.ContainsKey(scheduledaction.Name)) { _eventActions.Add(scheduledaction.Name, scheduledaction); } else { throw new Exception($"Scheduled action with name {scheduledaction.Name} already exists. Name should be unique"); } } //Return what we have added return(scheduledaction); }
/// <summary> /// Adds the specified scheduled action. /// </summary> /// <param name="scheduledaction">The scheduled action.</param> public void Add(ScheduledEventAction scheduledaction) => ScheduledActionsKeeper.Add(scheduledaction);