示例#1
0
        protected override IScreenFlowConfigurator OnRegisterUserActions(
            IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
        {
            var prestart = contextData.GetStepData <FlowInitializer.StartScreenModel>(ScreenName.PreStart);


            return(screenConfiguration.OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
                   .OnEventNavigatesTo(ScreenInputEvent.Reset, BlueFlowScreenName.Step0Screen)
                   .OnEventNavigatesTo(ScreenInputEvent.FlowTransitionCompleted, BlueFlowScreenName.FlowCompletedScreen, () => !prestart.MustReturnToCaller, "Not Called from another flow expecting result")
                   .OnEventNavigatesTo(ScreenInputEvent.FlowTransitionCompleted, BlueFlowScreenName.EndAndReturnToCaller, () => prestart.MustReturnToCaller, "Called from another flow expecting result")
                   .OnEventNavigatesTo(ScreenInputEvent.Previous, BlueFlowScreenName.FillDataStep_StepBScreen,
                                       () => !ByPassedStepAandB(), "Comes from B")
                   .OnEventNavigatesTo(ScreenInputEvent.Previous, BlueFlowScreenName.Step0Screen, ByPassedStepAandB,
                                       "Comes from step0")

                   .OnEventExecutes(ScreenInputEvent.Reset, (e, ctx) => ctx.Reset()));

            bool ByPassedStepAandB()
            {
                var stepValue1 = contextData
                                 .GetStepData <InitialScreen.InitialScreenScreenModel>(BlueFlowScreenName.Step0Screen).StepValue1;

                return(stepValue1 != null && stepValue1.StartsWith('a'));
            }
        }
示例#2
0
 protected override IScreenFlowConfigurator OnRegisterUserActions(
     IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
 {
     return(screenConfiguration
            .OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
            .OnEventNavigatesTo(ScreenInputEvent.Submit, ModelTesterFlowStep.FlowCompletedScreen));
 }
示例#3
0
        protected override IScreenFlowConfigurator OnRegisterUserActions(
            IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
        {
            return(screenConfiguration.OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
                   .OnEventNavigatesTo(ScreenInputEvent.Reset, GreenFlowScreenName.Step0Screen)
                   .OnEventNavigatesTo(ScreenInputEvent.Next, GreenFlowScreenName.StepCScreen)
                   .OnEventNavigatesTo(ScreenInputEvent.Previous, GreenFlowScreenName.StepAScreen)

                   .OnEventExecutes(ScreenInputEvent.Reset, (e, ctx) => ctx.Reset())
                   .OnEventExecutes(ScreenInputEvent.Previous, (e, ctx) => ctx.GetCurrentStepData <StepBScreenScreenModel>().StepBValue1 = null));
        }
示例#4
0
        protected override IScreenFlowConfigurator OnRegisterUserActions(
            IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
        {
            bool ToStepC()
            {
                var stepValue1 = contextData.GetCurrentStepData <InitialScreenScreenModel>().StepValue1;

                return(stepValue1 != null && stepValue1.StartsWith('a'));
            }

            return(screenConfiguration
                   .OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
                   .OnEventReentriesCurrent(ScreenInputEvent.Reset)
                   .OnEventNavigatesTo(ScreenInputEvent.Next, GreenFlowScreenName.StepAScreen, () => !ToStepC(), "input is NOT a*")
                   .OnEventNavigatesTo(ScreenInputEvent.Next, GreenFlowScreenName.StepCScreen, ToStepC, "input is a*")

                   .OnEventExecutes(ScreenInputEvent.Reset, (e, ctx) => ctx.Reset())
                   );
        }
示例#5
0
        protected override IScreenFlowConfigurator OnRegisterUserActions(
            IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
        {
            bool ByPassedStepAandB()
            {
                var stepValue1 = contextData.GetStepData <InitialScreen.InitialScreenScreenModel>(GreenFlowScreenName.Step0Screen).StepValue1;

                return(stepValue1 != null && stepValue1.StartsWith('a'));
            }

            return(screenConfiguration.OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
                   .OnEventNavigatesTo(ScreenInputEvent.Reset, GreenFlowScreenName.Step0Screen)
                   .OnEventNavigatesTo(ScreenInputEvent.FlowTransitionCompleted, GreenFlowScreenName.FlowCompletedScreen)
                   .OnEventNavigatesTo(ScreenInputEvent.Previous, GreenFlowScreenName.StepBScreen, () => !ByPassedStepAandB(), "Comes from B")
                   .OnEventNavigatesTo(ScreenInputEvent.Previous, GreenFlowScreenName.Step0Screen, ByPassedStepAandB, "Comes from step0")
                   .OnEventNavigatesTo(ScreenInputEvent.StartBlueFlow, GreenFlowScreenName.RunBlueFlow)

                   .OnEventExecutes(ScreenInputEvent.Reset, (e, ctx) => ctx.Reset()));
        }
示例#6
0
        protected override IScreenFlowConfigurator OnRegisterUserActions(
            IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
        {
            ThrowIfMustFail(contextData, ScreenLifecycleStage.DefiningTransitionsFromCurrentScreen);


            return(screenConfiguration
                   .OnEventReentriesCurrent(ScreenEvent.ErrorOccurred, () => contextData.LastError.LifecycleStage == ScreenLifecycleStage.ValidateTransitionCompletedWithErrors, "Validation error")
                   .OnEventNavigatesTo(ScreenEvent.ErrorOccurred, BlueFlowScreenName.ErrorScreen, () => contextData.LastError.LifecycleStage != ScreenLifecycleStage.ValidateTransitionCompletedWithErrors, "Not a validation error")
                   .OnEventReentriesCurrent(ScreenInputEvent.Reset)
                   .OnEventNavigatesTo(ScreenInputEvent.Next, BlueFlowScreenName.FillDataStep_StepAScreen, () => !ToStepC(),
                                       "input is NOT a*")
                   .OnEventNavigatesTo(ScreenInputEvent.Next, BlueFlowScreenName.StepCScreen, ToStepC, "input is a*")
                   .OnEventExecutes(ScreenInputEvent.Reset, OnReset));

            bool ToStepC()
            {
                var stepValue1 = contextData.GetCurrentStepData <InitialScreenScreenModel>().StepValue1;

                return(stepValue1 != null && stepValue1.StartsWith('a'));
            }
        }
示例#7
0
 protected override IScreenFlowConfigurator OnRegisterUserActions(
     IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
 {
     return(screenConfiguration.OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
            .OnEventNavigatesTo(ScreenInputEvent.ToStep2, ContainersFlow3ScreenName.Number2ContainerScreen));
 }