/// <summary> /// Adds the scheduled action. /// </summary> /// <param name="action">The action.</param> /// <param name="timeout">The timeout.</param> public void AddScheduledAction(ScheduledActiondDelegate action, TimeSpan timeout) { if (action == null) { throw new ArgumentNullException("action"); } if (timeout.TotalMilliseconds == 0) { throw new ArgumentException("timeout is zero", "timeout"); } SchedulerItem item = new DelegateSchedulerItem(action, timeout); this._schedulerItems.Add(item); }
/// <summary> /// Initializes a new instance of the <see cref="DelegateSchedulerItem"/> class. /// </summary> /// <param name="action">The action.</param> /// <param name="timeout">The timeout.</param> internal DelegateSchedulerItem(ScheduledActiondDelegate action, TimeSpan timeout) : base(timeout) { this._action = action; }