/// <summary>
        /// Activates a specific view.
        /// </summary>
        /// <param name="previousView">The view actually displayed.</param>
        /// <param name="taskId">An existing task identifier (a GUID associated with the task).</param>
        /// <param name="navGraph">A configured navigation graph name.</param>
        /// <param name="view">The name of the view to be displayed.</param>
        public virtual void ActivateView(string previousView, Guid taskId, string navGraph, string view)
        {
            //  create a session moniker
            var sessionMoniker = new SessionMoniker(navGraph, view, taskId);

            // store the moniker into the session, so the next view can get the task information
            sessionMoniker.StoreInSession();

            Int32 nQuerySign = view.LastIndexOf('?');
            String queryParams = (nQuerySign == -1) ? "" : view.Substring(nQuerySign, view.Length - nQuerySign);
            ViewSettings viewSettings = UIPConfiguration.Config.GetViewSettingsFromName(view);
            if (viewSettings == null)
                throw new Exception(string.Format("ExceptionViewConfigNotFound: {0}.", view));

            HttpContext.Current.Session[WebFormView.CurrentTaskKey] = taskId.ToString();
            redirectToNextView(previousView, viewSettings, queryParams);
        }
Exemple #2
0
        public void StartTask()
        {
            SetState(CreateState());
            //CurrentState.CurrentView = _startView.Name;
            CurrentState.Save();

            SessionMoniker sessionMoniker = new SessionMoniker(string.Empty, CurrentState.CurrentView, CurrentState.TaskId);
            sessionMoniker.StoreInSession();
            HttpContext.Current.Session[WebFormView.CurrentTaskKey] = CurrentState.TaskId.ToString();
        }