protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (this.SceneEnabled) { SceneUsageAttribute sceneControlAttr = TypeDescriptor.GetAttributes(this.Page)[typeof(SceneUsageAttribute)] as SceneUsageAttribute; if (sceneControlAttr == null) { throw new HttpException("Page必须使用SceneControlAttribute特性进行标注,才可以使用SceneControl"); } var scenes = ActHelper.GetActs(sceneControlAttr.SceneFileVirtualPath)[sceneControlAttr.ResolveActName(this.Page)].Scenes; if (scenes.Count > 0) { bool isCurrentTime = TimePointContext.Current.UseCurrentTime; string sceneName = sceneControlAttr.ResolveSceneName(Page, isCurrentTime); scenes[sceneName].RenderToControl(this.Page); if (isCurrentTime && this.Page is INormalSceneDescriptor) { ((INormalSceneDescriptor)this.Page).AfterNormalSceneApplied(); } } } }
protected override void OnPreRender(EventArgs e) { Act act = ActHelper.GetActs("~/App_Data/PropertyEditScene.xml")["propertyEdit"]; Scene currentScene = act.Scenes[TimePointContext.Current.UseCurrentTime ? "Normal" : "ReadOnly"]; this.RenderAllTabs(this.Data, currentScene); Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); currentScene.RenderToControl(this); base.OnPreRender(e); }