コード例 #1
0
        public StepTransitionResult Back()
        {
            if (!CanGoBack)
            {
                return(StepTransitionResult.Failure("This is the first step"));
            }

            _currentIndex--;
            return(StepTransitionResult.Success());
        }
コード例 #2
0
        public StepTransitionResult Next(Node node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }

            if (!CanGoForward)
            {
                return(StepTransitionResult.Failure("This is the last step"));
            }

            StepTransitionResult result = _steps[_currentIndex].Next(node);

            if (result.CanTransition)
            {
                _currentIndex++;
            }
            return(result);
        }