protected void btn_add_Click(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { string ids = Request.QueryString["id"].ToString(); if (ids != "0") { zs.Model.Tbl_Page model = bll.GetModel(int.Parse(ids)); model.name = this.tb_name.Text.Trim(); model.metatags = this.tb_tags.Text.Trim(); model.metadescription = ApplicationMethod.NoHtmlCode(this.tb_metadesc.Text.Trim(), 80); model.conts = Request.Form["myValue"].ToString(); bll.Update(model); BindData(); } else { zs.Model.Tbl_Page model = new zs.Model.Tbl_Page(); model.name = this.tb_name.Text.Trim(); model.metatags = this.tb_tags.Text.Trim(); model.metadescription = ApplicationMethod.NoHtmlCode(this.tb_metadesc.Text.Trim(), 80); model.conts = Request.Form["myValue"].ToString(); bll.Add(model); } } }
/// <summary> /// Fill method for populating an entire collection of ApplicationMethods /// </summary> public virtual void Fill(ApplicationMethods applicationMethods) { // create the connection to use SqlConnection cnn = new SqlConnection(ApplicationMethod.GetConnectionString()); try { using (cnn) { // open the connection cnn.Open(); // create an instance of the reader to fill. SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectApplicationMethods"); // Send the collection and data to the object factory CreateObjectsFromData(applicationMethods, datareader); // close the connection cnn.Close(); } // nullify the connection cnn = null; } catch (SqlException sqlex) { throw sqlex; } }
private void SetGuideDetail() { int id = SiteAbout.gInt("id"); string name = SiteAbout.gStr("name"); string url = SiteAbout.gStr("url"); string type = SiteAbout.gStr("type"); int sortid = SiteAbout.gInt("sortid"); if (id > 0) { zs.Model.Tbl_Guide modelGuide = bllGuide.GetModel(id); modelGuide.sortid = sortid; modelGuide.type = type; modelGuide.url = url; modelGuide.name = name; Response.ContentType = "application/json"; if (bllGuide.Update(modelGuide)) { if (type == "news") { modelGuide.url = "./newslist.aspx?id=" + ApplicationMethod.encript(id.ToString()); bllGuide.Update(modelGuide); } Response.Write("{\"status\":\"true\"}"); } else { Response.Write("{\"status\":\"false\"}"); } } else { if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(url) || string.IsNullOrEmpty(type)) { return; } zs.Model.Tbl_Guide modelGuide = new zs.Model.Tbl_Guide(); modelGuide.pid = 0; modelGuide.sortid = sortid; modelGuide.type = type; modelGuide.url = url; modelGuide.name = name; Response.ContentType = "application/json"; int ret = bllGuide.Add(modelGuide); if (ret > 0) { if (type == "news") { modelGuide.id = ret; modelGuide.url = "./newslist.aspx?id=" + ApplicationMethod.encript(ret.ToString()); bllGuide.Update(modelGuide); } Response.Write("{\"status\":\"true\"}"); } else { Response.Write("{\"status\":\"false\"}"); } } }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] ApplicationMethod applicationMethod) { if (id != applicationMethod.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(applicationMethod); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplicationMethodExists(applicationMethod.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(applicationMethod)); }
/// <summary> /// The object factory for a particular data collection instance. /// </summary> public virtual void CreateObjectsFromData(ApplicationMethods applicationmethods, System.Data.DataSet data) { // Do nothing if we have nothing if (data == null || data.Tables.Count == 0 || data.Tables[0].Rows.Count == 0) { return; } // Create a local variable for the new instance. ApplicationMethod newobj = null; // Create a local variable for the data row instance. System.Data.DataRow dr = null; // Iterate through the table rows for (int i = 0; i < data.Tables[0].Rows.Count; i++) { // Get a reference to the data row dr = data.Tables[0].Rows[i]; // Create a new object instance newobj = System.Activator.CreateInstance(applicationmethods.ContainsType[0]) as ApplicationMethod; // Let the instance set its own members newobj.SetMembers(ref dr); // Add the new object to the collection instance applicationmethods.Add(newobj); } }
private void BindData() { zs.BLL.Tbl_Video bll = new zs.BLL.Tbl_Video(); zs.BLL.Tbl_Guide bllg = new zs.BLL.Tbl_Guide(); id = ApplicationMethod.decript(Request.QueryString["id"]); UsersBind(bll.GetModelList("leiid=" + id), 12); string title = bllg.GetModelByCache(int.Parse(id)).name; }
private void InitData() { string xid = ApplicationMethod.decript(Request.QueryString["xid"]); this.Repeater1.DataSource = bll.GetModelList("xueyuanid=" + xid); this.Repeater1.DataBind(); zs.Model.Tbl_Xueyuan xueyuan = bllx.GetModelByCache(int.Parse(xid)); this.Page.Title = xueyuan.name + " - 专业介绍 - 浙江树人大学招生网"; name = xueyuan.name; }
private void UsersBind(List <zs.Model.Tbl_Video> userList, int pageSize)//repeater分页并绑定 { try { PagedDataSource objPage = new PagedDataSource(); objPage.DataSource = userList; objPage.AllowPaging = true; objPage.PageSize = pageSize; int CurPage; if (Request.QueryString["page"] != null) { CurPage = Convert.ToInt32(Request.QueryString["page"]); } else { CurPage = 1; } objPage.CurrentPageIndex = CurPage - 1; Repeater1.DataSource = objPage; Repeater1.DataBind(); RecordCount.Text = objPage.DataSourceCount.ToString(); PageCount.Text = objPage.PageCount.ToString(); Pageindex.Text = CurPage.ToString(); Literal1.Text = PageList(objPage.PageCount, CurPage); FirstPage.NavigateUrl = Request.CurrentExecutionFilePath + "?id=" + ApplicationMethod.encript(id) + "&page=1"; PrevPage.NavigateUrl = Request.CurrentExecutionFilePath + "?id=" + ApplicationMethod.encript(id) + "&page=" + (CurPage - 1); NextPage.NavigateUrl = Request.CurrentExecutionFilePath + "?id=" + ApplicationMethod.encript(id) + "&page=" + (CurPage + 1); LastPaeg.NavigateUrl = Request.CurrentExecutionFilePath + "?id=" + ApplicationMethod.encript(id) + "&page=" + objPage.PageCount.ToString(); if (CurPage <= 1 && objPage.PageCount <= 1) { FirstPage.NavigateUrl = ""; PrevPage.NavigateUrl = ""; NextPage.NavigateUrl = ""; LastPaeg.NavigateUrl = ""; } if (CurPage <= 1 && objPage.PageCount > 1) { FirstPage.NavigateUrl = ""; PrevPage.NavigateUrl = ""; } if (CurPage >= objPage.PageCount) { NextPage.NavigateUrl = ""; LastPaeg.NavigateUrl = ""; } } catch (Exception error) { Response.Write(error.ToString()); } finally { } }
public async Task <IActionResult> Create([Bind("Id,Name")] ApplicationMethod applicationMethod) { if (ModelState.IsValid) { _context.Add(applicationMethod); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(applicationMethod)); }
private void GetContent() { zs.BLL.Tbl_Page bll = new zs.BLL.Tbl_Page(); string id = ApplicationMethod.decript(Request.QueryString["id"]); zs.Model.Tbl_Page model = bll.GetModelByCache(int.Parse(id)); this.lb_title.Text = model.name; this.lb_Cont.Text = model.conts; tags = model.metatags; desc = model.metadescription; Page.Title = model.name + " - 浙江树人大学招生网"; }
private void GetContent() { zs.BLL.Tbl_News bll = new zs.BLL.Tbl_News(); string id = ApplicationMethod.decript(Request.QueryString["id"]); zs.Model.Tbl_News model = bll.GetModelByCache(int.Parse(id)); this.lb_title.Text = model.title; this.lb_Cont.Text = model.conts; tags = "浙江树人大学,招生网,树大招生," + model.title; desc = ApplicationMethod.NoHtmlCode(model.conts, 80); Page.Title = model.title + " - 浙江树人大学招生网"; }
protected void Button1_Click(object sender, EventArgs e) { zs.Model.Tbl_Message model = bll.GetModel(int.Parse(Request.QueryString["id"].ToString())); model.reply = this.TextBox1.Text.Trim(); model.replyTime = DateTime.Now; model.isShow = 1; bll.Update(model); string content = "<p>亲爱的" + name + "同学:</p><p style='text-indent:2em;'>您好!</p><p style='text-indent:2em;'>您于[" + asktime + "]在浙江树人大学招生网留言咨询:“" + conts + "”。</p><p style='text-indent:2em;'>我们的答复是:“" + this.TextBox1.Text.Trim() + "”。</p><p style='text-indent:2em;'>感谢您的咨询,愿我们的答案能让您满意!在此祝您生活幸福,学业有成!</p><p style='text-indent:2em;color:red'>(此邮件由zs.zjsru.edu.cn自动发送,请勿回复!)</p>"; this.Label1.Text = "回复成功!"; this.Label1.Text += ApplicationMethod.send_mail(mail, "浙江树人大学招生网留言回复", content, ""); }
void Update() { if (m_targetCamera != null) { if (m_targetCamera.actualRenderingPath != RenderingPath.DeferredShading) { if (PerPixelNormals != PerPixelNormalSource.None && PerPixelNormals != PerPixelNormalSource.Camera) { m_paramsChanged = true; PerPixelNormals = PerPixelNormalSource.Camera; UnityEngine.Debug.LogWarning("[AmplifyOcclusion] GBuffer Normals only available in Camera Deferred Shading mode. Switched to Camera source."); } if (ApplyMethod == ApplicationMethod.Deferred) { m_paramsChanged = true; ApplyMethod = ApplicationMethod.PostEffect; UnityEngine.Debug.LogWarning("[AmplifyOcclusion] Deferred Method requires a Deferred Shading path. Switching to Post Effect Method."); } } else { if (PerPixelNormals == PerPixelNormalSource.Camera) { m_paramsChanged = true; PerPixelNormals = PerPixelNormalSource.GBuffer; UnityEngine.Debug.LogWarning("[AmplifyOcclusion] Camera Normals not supported for Deferred Method. Switching to GBuffer Normals."); } } if ((m_targetCamera.depthTextureMode & DepthTextureMode.Depth) == 0) { m_targetCamera.depthTextureMode |= DepthTextureMode.Depth; } if ((PerPixelNormals == PerPixelNormalSource.Camera) && (m_targetCamera.depthTextureMode & DepthTextureMode.DepthNormals) == 0) { m_targetCamera.depthTextureMode |= DepthTextureMode.DepthNormals; } if ((UsingMotionVectors == true) && (m_targetCamera.depthTextureMode & DepthTextureMode.MotionVectors) == 0) { m_targetCamera.depthTextureMode |= DepthTextureMode.MotionVectors; } } else { m_targetCamera = GetComponent <Camera>(); } }
public string GetXueyuanList() { List <zs.Model.Tbl_Xueyuan> models = bllx.GetModelList(""); StringBuilder sb = new StringBuilder(); foreach (zs.Model.Tbl_Xueyuan model in models) { sb.Append("<li class=''>"); sb.Append("<a href='zhuanye.aspx?xid=" + ApplicationMethod.encript(model.id.ToString()) + "'>"); sb.Append(model.name + "</a></li>"); } return(sb.ToString()); }
private void GetContent() { zs.BLL.Tbl_Video bll = new zs.BLL.Tbl_Video(); string id = ApplicationMethod.decript(Request.QueryString["id"]); zs.Model.Tbl_Video model = bll.GetModelByCache(int.Parse(id)); this.lb_title.Text = model.title; conts = model.conts; videourl = model.videourl; this.Repeater1.DataSource = bll.GetList(5, "", "newid()"); this.Repeater1.DataBind(); }
private void GetNewsList() { zs.BLL.Tbl_News bll = new zs.BLL.Tbl_News(); zs.BLL.Tbl_Guide bllg = new zs.BLL.Tbl_Guide(); id = ApplicationMethod.decript(Request.QueryString["id"]); UsersBind(bll.GetModelList("leiid=" + id + " order by id desc"), 15); string title = bllg.GetModelByCache(int.Parse(id)).name; this.lb_title.Text = title; tags = "浙江树人大学,招生网,树大招生," + title; desc = "由浙江省政协主办的浙江树人大学(学院)坐落于杭州市城区,是改革开放以来我国最早成立并经国家教育部首批批准承认学历的全日制民办本科高校之一。"; Page.Title = title + " - 浙江树人大学招生网"; }
void UpdateParams() { prevScreenWidth = m_camera.pixelWidth; prevScreenHeight = m_camera.pixelHeight; prevHDR = m_camera.hdr; prevApplyMethod = ApplyMethod; prevSampleCount = SampleCount; prevPerPixelNormals = PerPixelNormals; prevCacheAware = CacheAware; prevDownscale = Downsample; prevBlurEnabled = BlurEnabled; prevBlurRadius = BlurRadius; prevBlurPasses = BlurPasses; }
/// <summary> /// Deletes the object. /// </summary> public virtual void Delete(ApplicationMethod deleteObject) { // create a new instance of the connection SqlConnection cnn = new SqlConnection(ApplicationMethod.GetConnectionString()); // create local variable array for the sql parameters SqlParameterHash sqlparams = null; try { // discover the parameters sqlparams = SqlHelperParameterCache.GetSpParameterSet(ApplicationMethod.GetConnectionString(), "gsp_DeleteApplicationMethod"); // Store the parameter for the Id attribute. sqlparams["@id"].Value = deleteObject.Id; using (cnn) { // open the connection cnn.Open(); // Execute the stored proc to perform the delete on the instance. SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_DeleteApplicationMethod", sqlparams); // close the connection after usage cnn.Close(); } // nullify the connection var cnn = null; } catch (SqlException sqlex) { throw sqlex; } // nullify the reference deleteObject = null; }
/// <summary> /// Fills a single instance with data based on its primary key values. /// </summary> public virtual void Fill(ApplicationMethod am, System.Int16 id) { // create the connection to use SqlConnection cnn = new SqlConnection(ApplicationMethod.GetConnectionString()); try { // discover the sql parameters SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(ApplicationMethod.GetConnectionString(), "gsp_SelectApplicationMethod"); using (cnn) { // open the connection cnn.Open(); // set the parameters sqlparams["@id"].Value = id; // create an instance of the reader to fill. SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectApplicationMethod", sqlparams); if (datareader.Read()) { am.SetMembers(ref datareader); } cnn.Close(); // close the connection } // nullify the connection var cnn = null; } catch (SqlException sqlex) { throw sqlex; } }
private void InitData() { string id = ApplicationMethod.decript(Request.QueryString["id"].ToString()); zs.Model.Tbl_Xueyuan model = bll.GetModelByCache(int.Parse(id)); name = model.name; nameen = model.nameen; conts = model.conts; yuanzhang = model.yuanzhang; image1 = model.image1; image2 = model.image2; image3 = model.image3; tags = "浙江树人大学招生网," + model.name; desc = ApplicationMethod.NoHtmlCode(model.conts, 80); xid = ApplicationMethod.encript(model.id.ToString()); this.Page.Title = model.name + " - 浙江树人大学招生网"; this.Repeater1.DataSource = bll.GetList(2, "", "newid()"); this.Repeater1.DataBind(); }
void Update() { if (m_camera.actualRenderingPath != RenderingPath.DeferredShading) { if (PerPixelNormals != PerPixelNormalSource.None && PerPixelNormals != PerPixelNormalSource.Camera) { // NOTE: use inspector warning box instead? PerPixelNormals = PerPixelNormalSource.Camera; UnityEngine.Debug.LogWarning("[AmplifyOcclusion] GBuffer Normals only available in Camera Deferred Shading mode. Switched to Camera source."); } if (ApplyMethod == ApplicationMethod.Deferred) { // NOTE: use inspector warning box instead? ApplyMethod = ApplicationMethod.PostEffect; UnityEngine.Debug.LogWarning("[AmplifyOcclusion] Deferred Method requires a Deferred Shading path. Switching to Post Effect Method."); } } if (ApplyMethod == ApplicationMethod.Deferred && PerPixelNormals == PerPixelNormalSource.Camera) { // NOTE: use inspector warning box instead? PerPixelNormals = PerPixelNormalSource.GBuffer; UnityEngine.Debug.LogWarning("[AmplifyOcclusion] Camera Normals not supported for Deferred Method. Switching to GBuffer Normals."); } if ((m_camera.depthTextureMode & DepthTextureMode.Depth) == 0) { m_camera.depthTextureMode |= DepthTextureMode.Depth; } if ((PerPixelNormals == PerPixelNormalSource.Camera) && (m_camera.depthTextureMode & DepthTextureMode.DepthNormals) == 0) { m_camera.depthTextureMode |= DepthTextureMode.DepthNormals; } CheckMaterial(); CheckRandomData(); }
protected void Button1_Click(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { string ids = Request.QueryString["id"].ToString(); if (ids != "0") { zs.Model.Tbl_User model = bll.GetModel(int.Parse(ids)); model.userName = this.tb_name.Text.Trim(); model.userPsw = ApplicationMethod.encript(this.tb_Psw.Text.Trim()); bll.Update(model); ViewState["userid"] = ids; } else { zs.Model.Tbl_User model = new zs.Model.Tbl_User(); model.userName = this.tb_name.Text.Trim(); model.userPsw = ApplicationMethod.encript(this.tb_Psw.Text.Trim()); bll.Add(model); ViewState["userid"] = bll.GetModelList("userName='******'")[0].id; } } }
/// <summary> /// The object factory for a particular data collection instance. /// </summary> public virtual void CreateObjectsFromData(ApplicationMethods applicationmethods, System.Data.SqlClient.SqlDataReader data) { // Do nothing if we have nothing if (data == null) { return; } // Create a local variable for the new instance. ApplicationMethod newobj = null; // Iterate through the data reader while (data.Read()) { // Create a new object instance newobj = System.Activator.CreateInstance(applicationmethods.ContainsType[0]) as ApplicationMethod; // Let the instance set its own members newobj.SetMembers(ref data); // Add the new object to the collection instance applicationmethods.Add(newobj); } }
protected void btn_Login_Click(object sender, EventArgs e) { zs.BLL.Tbl_User blluser = new zs.BLL.Tbl_User(); string userName = CheckInput(this.tb_userName.Text.Trim()); string userPSW = CheckInput(this.tb_password.Text.Trim()); if (blluser.Exists(userName)) { //存在用户名 if (blluser.GetModel(userName).userPsw == ApplicationMethod.encript(userPSW)) { //密码正确 Response.Cookies["userId"].Value = blluser.GetModel(userName).id.ToString(); Response.Cookies["userName"].Value = blluser.GetModel(userName).userName; Response.Redirect("./Default.aspx"); } else {//密码错误 ClientScript.RegisterClientScriptBlock(this.GetType(), "showPError", "<script>alert('用户名密码不正确,请确认!')</script>"); } } else {//用户名不存在 ClientScript.RegisterClientScriptBlock(this.GetType(), "showUError", "<script>alert('用户名密码不正确,请确认!')</script>"); } }
void UpdateParams() { prevScreenWidth = m_camera.pixelWidth; prevScreenHeight = m_camera.pixelHeight; #if UNITY_5_6_OR_NEWER prevHDR = m_camera.allowHDR; #else prevHDR = m_camera.hdr; #endif prevApplyMethod = ApplyMethod; prevSampleCount = SampleCount; prevPerPixelNormals = PerPixelNormals; prevCacheAware = CacheAware; prevDownscale = Downsample; prevFadeEnabled = FadeEnabled; prevFadeToIntensity = FadeToIntensity; prevFadeToRadius = FadeToRadius; prevFadeToPowerExponent = FadeToPowerExponent; prevFadeStart = FadeStart; prevFadeLength = FadeLength; prevBlurEnabled = BlurEnabled; prevBlurRadius = BlurRadius; prevBlurPasses = BlurPasses; }
protected void Button3_Click(object sender, EventArgs e) { this.TextBox1.Text = ApplicationMethod.decript(this.Label1.Text.Trim()); }
protected void Button1_Click(object sender, EventArgs e) { this.Label1.Text = ApplicationMethod.send_mail("*****@*****.**", "ceshi", "ceshi", "*****@*****.**"); }
void OnPreRender() { Profiler.BeginSample("AO - OnPreRender"); checkMaterials(true); if (m_targetCamera != null) { #if UNITY_EDITOR if ((m_targetCamera.cameraType == CameraType.SceneView) && (((PerPixelNormals == PerPixelNormalSource.GBuffer) && (m_targetCamera.orthographic == true)) || (PerPixelNormals == PerPixelNormalSource.Camera) && (SceneView.lastActiveSceneView.m_SceneLighting == false))) { PerPixelNormals = PerPixelNormalSource.None; } #endif bool deferredReflections = (GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections) != BuiltinShaderMode.Disabled); if ((m_prevPerPixelNormals != PerPixelNormals) || (m_prevApplyMethod != ApplyMethod) || (m_prevDeferredReflections != deferredReflections) || (m_commandBuffer_Parameters.cmdBuffer == null) || (m_commandBuffer_Occlusion.cmdBuffer == null) || (m_commandBuffer_Apply.cmdBuffer == null) ) { CameraEvent cameraStage = CameraEvent.BeforeImageEffectsOpaque; if (ApplyMethod == ApplicationMethod.Deferred) { cameraStage = deferredReflections ? CameraEvent.BeforeReflections : CameraEvent.BeforeLighting; } createCommandBuffer(ref m_commandBuffer_Parameters, "AmplifyOcclusion_Parameters_" + m_myIDstring, cameraStage); createCommandBuffer(ref m_commandBuffer_Occlusion, "AmplifyOcclusion_Compute_" + m_myIDstring, cameraStage); createCommandBuffer(ref m_commandBuffer_Apply, "AmplifyOcclusion_Apply_" + m_myIDstring, cameraStage); m_prevPerPixelNormals = PerPixelNormals; m_prevApplyMethod = ApplyMethod; m_prevDeferredReflections = deferredReflections; m_paramsChanged = true; } if ((m_commandBuffer_Parameters.cmdBuffer != null) && (m_commandBuffer_Occlusion.cmdBuffer != null) && (m_commandBuffer_Apply.cmdBuffer != null)) { if (AmplifyOcclusionCommon.IsStereoMultiPassEnabled(m_targetCamera) == true) { uint curStepIdx = (m_sampleStep >> 1) & 1; uint curEyeIdx = (m_sampleStep & 1); m_curTemporalIdx = (curEyeIdx * 2) + (0 + curStepIdx); m_prevTemporalIdx = (curEyeIdx * 2) + (1 - curStepIdx); } else { uint curStepIdx = m_sampleStep & 1; m_curTemporalIdx = 0 + curStepIdx; m_prevTemporalIdx = 1 - curStepIdx; } m_commandBuffer_Parameters.cmdBuffer.Clear(); UpdateGlobalShaderConstants(m_commandBuffer_Parameters.cmdBuffer); UpdateGlobalShaderConstants_Matrices(m_commandBuffer_Parameters.cmdBuffer); UpdateGlobalShaderConstants_AmbientOcclusion(m_commandBuffer_Parameters.cmdBuffer); checkParamsChanged(); if (m_paramsChanged) { m_commandBuffer_Occlusion.cmdBuffer.Clear(); commandBuffer_FillComputeOcclusion(m_commandBuffer_Occlusion.cmdBuffer); } m_commandBuffer_Apply.cmdBuffer.Clear(); if (ApplyMethod == ApplicationMethod.Debug) { commandBuffer_FillApplyDebug(m_commandBuffer_Apply.cmdBuffer); } else { if (ApplyMethod == ApplicationMethod.PostEffect) { commandBuffer_FillApplyPostEffect(m_commandBuffer_Apply.cmdBuffer); } else { bool logTarget = !m_HDR; commandBuffer_FillApplyDeferred(m_commandBuffer_Apply.cmdBuffer, logTarget); } } updateParams(); m_sampleStep++; // No clamp, free running counter } } else { m_targetCamera = GetComponent <Camera>(); Update(); #if UNITY_EDITOR if (m_targetCamera.cameraType != CameraType.SceneView) { System.Type T = System.Type.GetType("UnityEditor.GameView,UnityEditor"); UnityEngine.Object[] array = Resources.FindObjectsOfTypeAll(T); if (array.Length > 0) { EditorWindow gameView = (EditorWindow)array[0]; gameView.Focus(); } } #endif } Profiler.EndSample(); }
void OnPreRender() { Profiler.BeginSample("AO - OnPreRender"); checkMaterials(true); if (m_targetCamera != null) { bool deferredReflections = (GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections) != BuiltinShaderMode.Disabled); if ((m_prevPerPixelNormals != PerPixelNormals) || (m_prevApplyMethod != ApplyMethod) || (m_prevDeferredReflections != deferredReflections) || (m_commandBuffer_Occlusion.cmdBuffer == null) || (m_commandBuffer_Apply.cmdBuffer == null) ) { CameraEvent cameraStage = CameraEvent.BeforeImageEffectsOpaque; if (ApplyMethod == ApplicationMethod.Deferred) { cameraStage = deferredReflections ? CameraEvent.BeforeReflections : CameraEvent.BeforeLighting; } createCommandBuffer(ref m_commandBuffer_Occlusion, "AmplifyOcclusion_Compute", cameraStage); createCommandBuffer(ref m_commandBuffer_Apply, "AmplifyOcclusion_Apply", cameraStage); m_prevPerPixelNormals = PerPixelNormals; m_prevApplyMethod = ApplyMethod; m_prevDeferredReflections = deferredReflections; m_paramsChanged = true; } if ((m_commandBuffer_Occlusion.cmdBuffer != null) && (m_commandBuffer_Apply.cmdBuffer != null)) { m_curStepIdx = m_sampleStep & 1; UpdateGlobalShaderConstants(); checkParamsChanged(); UpdateGlobalShaderConstants_AmbientOcclusion(); UpdateGlobalShaderConstants_Matrices(); if (m_paramsChanged) { m_commandBuffer_Occlusion.cmdBuffer.Clear(); commandBuffer_FillComputeOcclusion(m_commandBuffer_Occlusion.cmdBuffer); } m_commandBuffer_Apply.cmdBuffer.Clear(); if (ApplyMethod == ApplicationMethod.Debug) { commandBuffer_FillApplyDebug(m_commandBuffer_Apply.cmdBuffer); } else { if (ApplyMethod == ApplicationMethod.PostEffect) { commandBuffer_FillApplyPostEffect(m_commandBuffer_Apply.cmdBuffer); } else { bool logTarget = !m_HDR; commandBuffer_FillApplyDeferred(m_commandBuffer_Apply.cmdBuffer, logTarget); } } updateParams(); m_sampleStep++; // No clamp, free running counter } } Profiler.EndSample(); }
/// <summary> /// Persists the object. /// </summary> public virtual void Persist(ApplicationMethod persistObject, SqlTransaction sqlTrans) { // create local variable array for the sql parameters SqlParameterHash sqlparams = null; // Create a local variable for the connection SqlConnection cnn = null; // Use the parameter overload or create a new instance if (sqlTrans == null) { cnn = new SqlConnection(ApplicationMethod.GetConnectionString()); } try { // discover the parameters if (persistObject.Persisted) { sqlparams = SqlHelperParameterCache.GetSpParameterSet(ApplicationMethod.GetConnectionString(), "gsp_UpdateApplicationMethod"); } else { sqlparams = SqlHelperParameterCache.GetSpParameterSet(ApplicationMethod.GetConnectionString(), "gsp_CreateApplicationMethod"); } // Store the parameter for the Name attribute. sqlparams["@name"].Value = persistObject.Name; // Store the parameter for the EnumeratedName attribute. sqlparams["@enumeratedName"].Value = persistObject.EnumeratedName; // Store the parameter for the Description attribute. if (!persistObject.DescriptionIsNull) { sqlparams["@description"].Value = persistObject.Description; } // Store the parameter for the Id attribute. sqlparams["@id"].Value = persistObject.Id; if (!persistObject.Persisted) { // store the create only (historical fixed) values } else { // store the update only (historical changeable) values } if (sqlTrans == null) { // Process using the isolated connection using (cnn) { // open the connection cnn.Open(); if (!persistObject.Persisted) { SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateApplicationMethod", sqlparams); } else { SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateApplicationMethod", sqlparams); } // close the connection after usage cnn.Close(); } // nullify the connection var cnn = null; } else { // Process using the shared transaction if (!persistObject.Persisted) { SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateApplicationMethod", sqlparams); } else { SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateApplicationMethod", sqlparams); } } } catch (SqlException sqlex) { throw sqlex; } }