Example #1
0
 protected void StartNextAction()
 {
     if (SubDialogs.Any() && _currentSubDialogIndex < SubDialogs.Count())
     {
         _currentSubDialogIndex++;
         SubDialogs.ElementAt(_currentSubDialogIndex - 1).LoadDialog();
     }
     else if (!DialogCompletionCommit)
     {
         DialogCompletionCommit = true;
         CompleteDialog();
     }
     else
     {
         if (ParentDialog != null)
         {
             ParentDialog.StartNextAction();
         }
         else
         {
             ApplicationController.LogEvent(DialogEventName + " Completed", GetPropertiesForCompletedLog());
             if (OverideCompletionScreenMethod != null)
             {
                 OverideCompletionScreenMethod();
             }
             else
             {
                 Controller.ShowCompletionScreen(this);
             }
         }
     }
 }
Example #2
0
        protected void MoveBackToPrevious()
        {
            if (ParentDialog == null)
            {
                throw new Exception("Cannot Move Back. Parent Dialog Is Null");
            }
            if (ParentDialog._currentSubDialogIndex < 2)
            {
                throw new NotImplementedException("Cannot Move Back. Not Implemented For The First Child Dialog Of The Parent");
            }
            var previousDialog = ParentDialog.SubDialogs.ElementAt(ParentDialog._currentSubDialogIndex - 2);

            previousDialog.DialogCompletionCommit = false;
            ParentDialog._currentSubDialogIndex   = ParentDialog._currentSubDialogIndex - 2;
            ParentDialog.StartNextAction();
        }