/// <summary> /// Renders the content of a custom chart. /// </summary> /// <param name="context">The current http context.</param> private void RenderContent(HttpContext context) { // Get the id of the custom chart to render. Guid idCustomChart = Guid.Parse(context.Request.Params["Id"]); // Build the full path to the custom chart definition file. string fileName = Path.Combine( context.Request.PhysicalApplicationPath, "Fileadmin", "CustomCharts", Global.Core.ClientName, idCustomChart + ".xml" ); Homescreen homescreen = new Homescreen(fileName); //homescreen.ContentWidth = int.Parse(context.Request.Params["ContentWidth"]); //homescreen.ContentHeight = int.Parse(context.Request.Params["ContentHeight"]); homescreen.ContentWidth = "ContentWidth"; homescreen.ContentHeight = "ContentHeight"; homescreen.Parse(); homescreen.Render(); string result = File.ReadAllText(Path.Combine( context.Request.PhysicalApplicationPath, "App_Data", "CustomCharts", "CustomChart.html" )).Replace("###CONTENT###", homescreen.ToHtml()); context.Response.ContentType = "text/html"; context.Response.Write(result); }
protected void Default_Load(object sender, EventArgs e) { /*Response.Clear(); * foreach (string key in HttpContext.Current.Session.Keys) * { * try * { * byte[] bytes = HttpContext.Current.Session[key].ToByteArray(); * Response.Write(string.Format( * "{0}: Before: {1}, After: {2} <br />", * key, * HttpContext.Current.Session[key].ToString(), * HttpContext.Current.Session[key].GetType().FromByteArray(bytes) * )); * } * catch (Exception ex) * { * //Response.Write(ex.Message + "<br />\n"); * Response.Write(string.Format( * "FAILED: {0} TYPE: {1}<br />", * key, * HttpContext.Current.Session[key].GetType().Name * )); * } * } * Response.End();*/ if (Request.Params["Method"] != null) { Response.Clear(); switch (Request.Params["Method"]) { case "GotoLibrary": GotoLibrary(); break; } Response.End(); return; } // Build the path to the user's home screen definition file. string fileName = Path.Combine( Request.PhysicalApplicationPath, "Fileadmin", "HomeDefinitions", Global.Core.ClientName, Global.IdUser.Value + ".xml" ); if (!Directory.Exists(Path.GetDirectoryName(fileName))) { Directory.CreateDirectory(Path.GetDirectoryName(fileName)); } // Check if the user has a homescreen defined. if (!File.Exists(fileName)) { // Build the path to the client's home screen definition file. string fileNameClient = Path.Combine( Request.PhysicalApplicationPath, "Fileadmin", "HomeDefinitions", Global.Core.ClientName + ".xml" ); // Check if the client has a homescreen defined. if (!File.Exists(fileNameClient)) { // Build the full path to the default homescreen definition. string fileNameDefault = Path.Combine( Request.PhysicalApplicationPath, "App_Data", "Homescreen.xml" ); File.Copy( fileNameDefault, fileNameClient ); } File.Copy( fileNameClient, fileName ); } Homescreen homescreen = new Homescreen(fileName); //homescreen.ContentWidth = base.ContentWidth - 40; //homescreen.ContentHeight = base.ContentHeight - 103; homescreen.ContentWidth = "ContentWidth - 50"; homescreen.ContentHeight = "ContentHeight - 55"; homescreen.BaseContentWidth = base.ContentWidth - 50; homescreen.BaseContentHeight = base.ContentHeight - 55; homescreen.Parse(); pnlHomeContainer.Controls.Add(homescreen); }