Beispiel #1
0
        public IStep Clone()
        {
            var step = new Step { Name = Name, Screen = Screen, Controller = Controller };

            foreach (var action in Actions)
                step.Actions.Add(action.Key, action.Value);

            if (Parameters != null)
                foreach (var parameter in Parameters)
                    step.Parameters.Add(parameter.Key, parameter.Value);

            return step;
        }
Beispiel #2
0
 void ClearState()
 {
     _history.Clear();
     _currentStep = null;
 }
Beispiel #3
0
        void DoForward(IApplicationContext ctx, Step step, Dictionary<String, object> parameters = null, bool isBackCommand = false)
        {
            string lastStep = _currentStep != null ? _currentStep.Name : "null";
            string nextStep = step != null ? step.Name : "null";
            object allowed = InvokeCallback(WorkflowForwardingEvent
                  , lastStep
                  , nextStep
                  , parameters);

            if (allowed != null && !(allowed is bool))
                throw new JsException(string.Format(
                    "Function {0} returned incorrect value: {1}", WorkflowForwardingEvent, allowed));

            if (allowed == null || (bool)allowed)
            {
                LogManager.Logger.WorkflowForward(nextStep, parameters);

                OpenScreen(ctx, step, parameters, isBackCommand);

                InvokeCallback(WorkflowForwardEvent
                    , lastStep
                    , nextStep
                    , parameters);
            }
            else
            {
                LogManager.Logger.WorkflowForwardNotAllowed(nextStep, parameters);
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
Beispiel #4
0
        void OpenScreen(IApplicationContext ctx, Step step, Dictionary<String, object> parameters = null, bool isBackCommand = false)
        {
            step.Parameters = parameters;
            if (_currentStep != step)
            {
                step.Init();
                _history.Push(step);
                _currentStep = step;
            }

            string controller = String.IsNullOrEmpty(step.Controller) ? Controller : step.Controller;
            ctx.OpenScreen(step.Screen, controller, step.Parameters, isBackCommand);
        }
Beispiel #5
0
 public void AddChild(object obj)
 {
     var step = (Step)obj;
     if (_firstStep == null)
         _firstStep = step;
     _steps.Add(step.Name, step);
 }