/// <summary>
 /// Gets all events for every state in this state list <paramref name="stateList" /> with type <paramref name="type"/>.
 /// </summary>
 /// <param name="stateList">The state list.</param>
 /// <param name="type">The type of events to be retrieved.</param>
 /// <returns>
 /// A list of all events for every state in this state list <paramref name="stateList" /> with type <paramref name="type"/>.
 /// </returns>
 public static WorkflowTransitionActionList GetAllEvents(this WorkflowStateList stateList, WorkflowTransitionActionType type)
 {
     return new WorkflowTransitionActionList(stateList.SelectMany(s => s.GetAllEvents(type)));
 }
 /// <summary>
 /// Gets all events for every transition under this state <paramref name="state" /> with type <paramref name="type" />.
 /// </summary>
 /// <param name="state">The state.</param>
 /// <param name="type">The type of events to be retrieved.</param>
 /// <returns>
 /// A list of events for every transition under this state <paramref name="state" /> with type <paramref name="type" />.
 /// </returns>
 public static WorkflowTransitionActionList GetAllEvents(this WorkflowState state, WorkflowTransitionActionType type)
 {
     return new WorkflowTransitionActionList(state.GetAllEvents().Where(e => e.Type == type));
 }