예제 #1
0
        private void WebFormView_Load(object sender, System.EventArgs e)
        {
            _sessionMoniker = GetSessionMoniker();
            Navigator navigator = GetNavigator(_sessionMoniker.NavGraphName, _sessionMoniker.TaskId);

            _controller = navigator.GetController(this);
        }
예제 #2
0
        /// <summary>
        /// Gets the running tasks in the manager.
        /// </summary>
        /// <returns>An array with the task identifiers.</returns>
        public Guid[] GetCurrentTasks()
        {
            SessionMoniker[] monikers = SessionMoniker.GetAllFromSession();
            Guid[]           tasks    = new Guid[monikers.Length];
            for (int index = 0; index < monikers.Length; index++)
            {
                tasks[index] = monikers[index].TaskId;
            }

            return(tasks);
        }
예제 #3
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 void ActivateView(string previousView, Guid taskId, string navGraph, string view)
        {
            //  create a session moniker
            SessionMoniker sessionMoniker = new SessionMoniker(navGraph, view, taskId);

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

            ViewSettings viewSettings = UIPConfiguration.Config.GetViewSettingsFromName(view);

            if (viewSettings == null)
            {
                throw new UIPException(Resource.ResourceManager.FormatMessage(Resource.Exceptions.RES_ExceptionViewConfigNotFound, view));
            }

            HttpContext.Current.Session[WebFormView.CurrentTaskKey] = taskId.ToString();

            RedirectToNextView(previousView, viewSettings);
        }
예제 #4
0
        private SessionMoniker GetSessionMoniker()
        {
            SessionMoniker sessionMoniker = SessionMoniker.GetFromSession(new Guid(Session[CurrentTaskKey].ToString()));

            return(sessionMoniker);
        }