source: code/Website/dot-net-library/written-by-xiao-yifang/OpenFlashChart/ChartControlDesigner.cs@ 7849

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using System.Web.UI.Design;
6
7namespace OpenFlashChart
8{
9 public class ChartControlDesigner : ControlDesigner
10 {
11 public override string GetDesignTimeHtml()
12 {
13 string errorDesignTimeHtml;
14 StringBuilder builder = new StringBuilder();
15 try
16 {
17 OpenFlashChartControl component = (OpenFlashChartControl)base.Component;
18 OpenFlashChartControl chart = component;
19 builder.AppendFormat("<div style='width:{0};height:{1};'>", chart.Width, chart.Height);
20 builder.Append("<span style=\"font-size:16px;position:absolute;\">Open Flash Chart Control</span>");
21
22 builder.Append("</div>");
23 errorDesignTimeHtml = this.CreatePlaceHolderDesignTimeHtml(builder.ToString());
24 }
25 catch (Exception e)
26 {
27 errorDesignTimeHtml = this.GetErrorDesignTimeHtml(e);
28 }
29 return errorDesignTimeHtml;
30 }
31
32 protected override string GetErrorDesignTimeHtml(Exception e)
33 {
34 string instruction = string.Format("Exception:{0}", e.Message );
35 return this.CreatePlaceHolderDesignTimeHtml(instruction);
36 }
37 }
38}
Note: See TracBrowser for help on using the repository browser.