Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            _sessionMoniker = GetSessionMoniker();
            Navigator navigator = GetNavigator(_sessionMoniker.NavGraphName, _sessionMoniker.TaskId);

            if (viewSettings != null
                && viewSettings.AppTransactionStartConfigured
                && !IsPostBack)
            {
                navigator.CurrentState.Clear();
            }

            _controller = navigator.GetController(this, string.Empty);
            if (_controller == null)
                return;

            Load += _controller.OnLoadView;
            PreRender += _controller.OnPreRenderView;
            Unload += _controller.OnUnloadView;
        }
Esempio n. 3
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();
        }
Esempio n. 4
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            _sessionMoniker = GetSessionMoniker();
            _navigator = GetNavigator(_sessionMoniker.NavGraphName, _sessionMoniker.TaskId);
        }