/// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public TaskExecutionContext(object eventSource, TaskEventArgs eventArgs, string triggerName)
 {
     EventSource = eventSource;
     EventArgs = eventArgs;
     Exceptions = new List<System.Exception>();
     TriggerName = triggerName;
 }
        /// <summary>
        /// Executes the task in the current context synchronously
        /// </summary>
        /// <param name="triggerName">Name of the trigger.</param>
        /// <param name="sender">The sender.</param>
        /// <param name="eventArgs">The <see cref="TaskEventArgs"/> instance containing the event data.</param>
        /// <returns>The <see cref="TaskExecutionContext"/> in which the tasks run.</returns>
        public TaskExecutionContext ExecuteInContext(string triggerName, object sender, TaskEventArgs eventArgs)
        {
            var taskExecutionContext = new TaskExecutionContext(sender, eventArgs);

            ExecuteInContext(triggerName, taskExecutionContext);
            return(taskExecutionContext);
        }
 public TaskExecutionContext(object eventSource, TaskEventArgs eventArgs)
     : this(eventSource, eventArgs, string.Empty)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public TaskExecutionContext(object eventSource, TaskEventArgs eventArgs)
 {
     EventSource = eventSource;
     EventArgs   = eventArgs;
     Exceptions  = new List <System.Exception>();
 }