Rev | Line | |
---|
[7849] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Text;
|
---|
| 4 |
|
---|
| 5 | using System.Web.UI.Design;
|
---|
| 6 |
|
---|
| 7 | namespace 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.