Files
crm.e5.pl/include/ECM/open_flash_chart2/dot-net-library/written-by-xiao-yifang/OpenFlashChart/ChartControlDesigner.cs
2024-04-27 09:23:34 +02:00

39 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.Design;
namespace OpenFlashChart
{
public class ChartControlDesigner : ControlDesigner
{
public override string GetDesignTimeHtml()
{
string errorDesignTimeHtml;
StringBuilder builder = new StringBuilder();
try
{
OpenFlashChartControl component = (OpenFlashChartControl)base.Component;
OpenFlashChartControl chart = component;
builder.AppendFormat("<div style='width:{0};height:{1};'>", chart.Width, chart.Height);
builder.Append("<span style=\"font-size:16px;position:absolute;\">Open Flash Chart Control</span>");
builder.Append("</div>");
errorDesignTimeHtml = this.CreatePlaceHolderDesignTimeHtml(builder.ToString());
}
catch (Exception e)
{
errorDesignTimeHtml = this.GetErrorDesignTimeHtml(e);
}
return errorDesignTimeHtml;
}
protected override string GetErrorDesignTimeHtml(Exception e)
{
string instruction = string.Format("Exception:{0}", e.Message );
return this.CreatePlaceHolderDesignTimeHtml(instruction);
}
}
}