Exemplo n.º 1
0
        /// <summary>
        /// PreRender之后,准备保存ViewState
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRenderComplete(EventArgs e)
        {
            PerformanceMonitorHelper.GetDefaultMonitor().WriteExecutionDuration("ViewBase-PreRenderComplete", () =>
            {
                CommandStateHelper.SaveViewState();

                if (Scene.Current != null)
                {
                    Scene.Current.SaveViewState();
                }

                base.OnPreRenderComplete(e);
            });
        }
        protected virtual void OnPrepareCommandState(IWfProcess process)
        {
            if (PrepareCommandState != null)
            {
                PerformanceMonitorHelper.GetDefaultMonitor().WriteExecutionDuration("PrepareCommandState", () =>
                {
                    CommandStateBase state = PrepareCommandState(process);

                    if (state != null)
                    {
                        CommandStateHelper.RegisterState(state);
                    }
                });
            }
        }
Exemplo n.º 3
0
        private void OnProcessReadyHandler(IWfProcess process)
        {
            if (process.LoadingType == DataLoadingType.Cloned)
            {
                string sourceResourceID = WebUtility.GetRequestQueryString("sourceResourceID", string.Empty);

                ICommandStatePersist originalState = LoadStateByResourceID(sourceResourceID);

                ExceptionHelper.FalseThrow(originalState != null, "CopyForm时,必须实现LoadStateByResourceID方法");
                ICommandStatePersist persistedState = (ICommandStatePersist)originalState;

                CommandStateBase newState = (CommandStateBase)persistedState.CloneBusinessObject();

                CommandStateHelper.RegisterState(newState);
            }
        }
Exemplo n.º 4
0
 protected override void CreateChildControls()
 {
     this.viewData = (T)CommandStateHelper.GetCommandState(typeof(T));
     base.CreateChildControls();
 }