Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds the specified scheduled action.
 /// </summary>
 /// <param name="scheduledaction">The scheduled action.</param>
 public void Add(ScheduledEventAction scheduledaction) =>
 ScheduledActionsKeeper.Add(scheduledaction);