Exemplo n.º 1
0
 /// <summary>
 /// Return all events of a specific event type. e.g. ActivityFailedEvent, ActivityTimedoutEvent
 /// </summary>
 /// <typeparam name="TEvent"></typeparam>
 /// <param name="workflowItem"></param>
 /// <param name="includeRescheduleTimerEvents"></param>
 /// <returns></returns>
 public static IEnumerable <TEvent> Events <TEvent>(this IWorkflowItem workflowItem, bool includeRescheduleTimerEvents = false) where TEvent : WorkflowItemEvent
 {
     Ensure.NotNull(workflowItem, "workflowItem");
     return(workflowItem.AllEvents(includeRescheduleTimerEvents).OfType <TEvent>());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Return all events of a specific event type. e.g. ActivityFailedEvent, ActivityTimedoutEvent
 /// </summary>
 /// <param name="workflowItem"></param>
 /// <param name="eventType"></param>
 /// <param name="includeRescheduleTimerEvents"></param>
 /// <returns></returns>
 public static IEnumerable <WorkflowItemEvent> Events(this IWorkflowItem workflowItem, Type eventType, bool includeRescheduleTimerEvents = false)
 {
     Ensure.NotNull(workflowItem, "workflowItem");
     return(workflowItem.AllEvents(includeRescheduleTimerEvents).Where(e => e.GetType() == eventType));
 }