private EventsHandler(string tag, TInput stackInput, TState state, Emptyable <Tin> input, IStackEvents <TOperationEvent> stackEvents, Func <TEvent, bool> filter = null) : base(tag, stackInput, state, input, stackEvents) { Input = input; events = stackEvents.FilterErrors(null, filter); IsEmptyEventBlock = !events.Any(); }
public BlockResult <T> Complete(object overrideResult) { return(new BlockResult <T> { Target = new BlockResultTarget { FlowTarget = BlockFlowTarget.Complete, OverrideResult = Emptyable.Create(overrideResult) } }); }
public BlockResult <T> Retry(object overrideInput) { return(new BlockResult <T> { Target = new BlockResultTarget { FlowTarget = BlockFlowTarget.Retry, OverrideInput = Emptyable.Create(overrideInput) } }); }
public BlockResult <T> Goto(int index, object overrideInput) { return(new BlockResult <T> { Target = new BlockResultTarget { FlowTarget = BlockFlowTarget.Goto, TargetIndex = index, OverrideInput = Emptyable.Create(overrideInput) } }); }
public BlockResult <T> Goto(string tag, object overrideInput) { return(new BlockResult <T> { Target = new BlockResultTarget { FlowTarget = BlockFlowTarget.Goto, TargetTag = tag, OverrideInput = Emptyable.Create(overrideInput) } }); }
public BlockResult <T> Skip(int i, object overrideInput) { return(new BlockResult <T> { Target = new BlockResultTarget { FlowTarget = BlockFlowTarget.Skip, TargetIndex = i, OverrideInput = Emptyable.Create(overrideInput) } }); }
private ErrorsHandler(string tag, TInput stackInput, TState state, Emptyable <Tin> input, IStackEvents <TOperationEvent> stackEvents, Func <TError, bool> filter = null, bool?handled = null, bool handle = false) : base(tag, stackInput, state, input, stackEvents) { Input = input; errors = stackEvents.FilterErrors(handled, filter); if (handle) { foreach (var e in errors) { e.Handle(); } } IsEmptyEventBlock = !errors.Any(); }
public Emptyable <Tout> ConvertTo <Tout>() { Emptyable <Tout> e = new Emptyable <Tout>(); if (!IsEmpty) { if (typeof(T) == typeof(Tout)) { e = new Emptyable <Tout>(((Tout)(object)value)); } else if (typeof(T) != typeof(Tout)) { e = new Emptyable <Tout>((Tout)Convert.ChangeType(value, typeof(T))); } } return(e); }
public IEmptyable ConvertTo(Type type) { if (!IsEmpty) { if (typeof(T) == type) { return(Emptyable.Create(value)); } else { return(Emptyable.Create(Convert.ChangeType(value, type))); } } else { return(Emptyable.Create(type)); } }
public ErrorsHandler(string tag, TInput stackInput, TState state, Emptyable <Tin> input, IStackEvents <TOperationEvent> stackEvents, Action <IErrorsHandler <TError, TInput, TState, TOperationEvent, Tin> > action, Func <TError, bool> filter = null, bool?handled = null, bool handle = false) : this(tag, stackInput, state, input, stackEvents, filter, handled, handle) { executor = () => { action(this); return(Return(input.Value)); }; }
public ErrorsHandler(string tag, TInput stackInput, TState state, Emptyable <Tin> input, IStackEvents <TOperationEvent> stackEvents, Func <IErrorsHandler <TError, TInput, TState, TOperationEvent, Tin>, BlockResult <Tin> > func, Func <TError, bool> filter = null, bool?handled = null, bool handle = false) : this(tag, stackInput, state, input, stackEvents, filter, handled, handle) { executor = () => func(this); }
internal BlockResult(Emptyable <T> result) { Result = result; }
internal BlockResult() { Result = new Emptyable <T>(); }
public QueryResult(bool success, IEnumerable <BlockTraceResult <TOperationEvent> > stackTrace, TInput stackInput, TState stackState, Emptyable <T> result) : base(success, stackTrace, stackInput, stackState) { Result = result; }
public EventsHandler(string tag, TInput stackInput, TState state, Emptyable <Tin> input, IStackEvents <TOperationEvent> stackEvents, Func <IEventsHandler <TEvent, TInput, TState, TOperationEvent, Tin>, BlockResult <Tin> > func, Func <TEvent, bool> filter = null) : this(tag, stackInput, state, input, stackEvents, filter) { executor = () => func(this); }