コード例 #1
0
ファイル: InputScreen.cs プロジェクト: weedkiller/flox
 protected override IScreenFlowConfigurator OnRegisterUserActions(
     IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
 {
     return(screenConfiguration
            .OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
            .OnEventNavigatesTo(ScreenInputEvent.Submit, ModelTesterFlowStep.FlowCompletedScreen));
 }
コード例 #2
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'));
            }
        }
コード例 #3
0
        protected override IScreenFlowConfigurator OnRegisterUserActions(
            IScreenFlowConfigurator screenConfiguration,
            IUiFlowContextData contextData)
        {
            return(screenConfiguration
                   .OnEventNavigatesTo(ScreenInputEvent.BlueFlowCompleted, GreenFlowScreenName.FlowCompletedScreen)

                   .OnEventExecutes(ScreenInputEvent.BlueFlowCompleted,
                                    (e, ctx) => ctx.GetCurrentStepData <StepData>().BlueFlowCompletedEventHandled = true));
        }
コード例 #4
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));
        }
コード例 #5
0
        public IScreenFlowConfigurator DefineActionHandlersOnCurrentScreen(IScreenFlowConfigurator screenConfiguration,
                                                                           IUiFlowContextData contextData)
        {
            TraceBegin(nameof(DefineActionHandlersOnCurrentScreen), contextData);
            LifecycleStage = ScreenLifecycleStage.DefiningTransitionsFromCurrentScreen;
            var cfg = OnRegisterUserActions(screenConfiguration, contextData);
            var internalScreenFlowConfigurator = ((IInternalScreenFlowConfigurator)cfg);

            internalScreenFlowConfigurator.AddErrorTransitionIfUndefined();
            this.Transitions    = internalScreenFlowConfigurator.Transitions;
            this._eventHandlers = internalScreenFlowConfigurator.Handlers;
            LifecycleStage      = ScreenLifecycleStage.DefineTransitionsFromCurrentScreenCompleted;
            TraceEnd(nameof(DefineActionHandlersOnCurrentScreen), contextData);
            return(cfg);
        }
コード例 #6
0
ファイル: InitialScreen.cs プロジェクト: weedkiller/flox
        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())
                   );
        }
コード例 #7
0
ファイル: StepCScreen.cs プロジェクト: weedkiller/flox
        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()));
        }
コード例 #8
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'));
            }
        }
コード例 #9
0
ファイル: FlowInitializer.cs プロジェクト: weedkiller/flox
 public override IScreenFlowConfigurator OnDefiningAdditionalInitialStateTransitions(IScreenFlowConfigurator preStartCfg,
                                                                                     UiFlowContextData contextData)
 {
     return(preStartCfg.OnEventNavigatesTo(ScreenEvent.ErrorOccurred, StartFailureFlowScreenName.FailureScreen));
 }
コード例 #10
0
 protected virtual IScreenFlowConfigurator OnRegisterUserActions(
     IScreenFlowConfigurator screenConfiguration,
     IUiFlowContextData contextData)
 {
     return(screenConfiguration);
 }
コード例 #11
0
 protected override IScreenFlowConfigurator OnRegisterUserActions(IScreenFlowConfigurator screenConfiguration,
                                                                  IUiFlowContextData contextData)
 {
     return(screenConfiguration.OnEventNavigatesTo(ScreenInputEvent.BackToEditValues, ModelTesterFlowStep.InputScreen));
 }
コード例 #12
0
 protected override IScreenFlowConfigurator OnRegisterUserActions(
     IScreenFlowConfigurator screenConfiguration, IUiFlowContextData contextData)
 {
     return(screenConfiguration.OnEventReentriesCurrent(ScreenEvent.ErrorOccurred)
            .OnEventNavigatesTo(ScreenInputEvent.ToStep2, ContainersFlow3ScreenName.Number2ContainerScreen));
 }
コード例 #13
0
 public override IScreenFlowConfigurator OnDefiningAdditionalInitialStateTransitions(IScreenFlowConfigurator preStartCfg,
                                                                                     UiFlowContextData contextData)
 {
     return(preStartCfg.OnEventNavigatesTo(ScreenEvent.Start, ModelTesterFlowStep.InputScreen));
 }
コード例 #14
0
ファイル: FlowInitializer.cs プロジェクト: weedkiller/flox
 public override IScreenFlowConfigurator OnDefiningAdditionalInitialStateTransitions(IScreenFlowConfigurator preStartCfg,
                                                                                     UiFlowContextData contextData)
 {
     return(preStartCfg.OnEventNavigatesTo(ScreenEvent.Start, GreenFlowScreenName.Step0Screen
                                           , () => contextData.GetCurrentStepData <StartScreenModel>().SampleParameter != "Finish"
                                           , "normal start"
                                           )
            .OnEventNavigatesTo(ScreenEvent.Start, GreenFlowScreenName.FlowCompletedScreen
                                , () => contextData.GetCurrentStepData <StartScreenModel>().SampleParameter == "Finish"
                                , "straight to the end"
                                ));
 }
コード例 #15
0
 OnDefiningAdditionalInitialStateTransitions(IScreenFlowConfigurator preStartCfg,
                                             UiFlowContextData contextData)
 {
     return(preStartCfg);
 }
コード例 #16
0
 public override IScreenFlowConfigurator OnDefiningAdditionalInitialStateTransitions(IScreenFlowConfigurator preStartCfg,
                                                                                     UiFlowContextData contextData)
 {
     return(preStartCfg.OnEventNavigatesTo(ScreenEvent.Start, ContainersFlowScreenName.Number1ContainerScreen));
 }
コード例 #17
0
 public override IScreenFlowConfigurator OnDefiningAdditionalInitialStateTransitions(IScreenFlowConfigurator preStartCfg,
                                                                                     UiFlowContextData contextData)
 {
     return(preStartCfg.OnEventNavigatesTo(ScreenEvent.Start, MetadataTestFlowScreenScreenName.Step0Screen));
 }