/// <summary> /// Instantiates a new instance of the <see cref="Operation{TState}"/> class /// </summary> /// <param name="event">Event which can trigger a transition to the operationState</param> /// <param name="operationStates">State which represent the in-progress operation</param> /// <param name="successStates">States which can be transitioned to from the operationState which indicate a successful operation</param> public Operation(Event <TEventData> @event, IEnumerable <TState> operationStates, IEnumerable <TState> successStates) { this.operationInner = new OperationInner <TState, Event <TEventData> >(@event, new ReadOnlyCollection <TState>(operationStates.ToList()), new ReadOnlyCollection <TState>(successStates.ToList())); }
/// <summary> /// Instantiates a new instance of the <see cref="Operation{TState}"/> class /// </summary> /// <param name="event">Event which can trigger a transition to the operationState</param> /// <param name="operationState">State which represents the in-progress operation</param> /// <param name="successStates">States which can be transitioned to from the operationState which indicate a successful operation</param> public Operation(Event <TEventData> @event, TState operationState, params TState[] successStates) { this.operationInner = new OperationInner <TState, Event <TEventData> >(@event, new ReadOnlyCollection <TState>(new[] { operationState }), new ReadOnlyCollection <TState>(successStates)); }