AODL.Document.Export.Html.HTMLContentBuilder.GetDrawAreaAsHtml C# (CSharp) Метод

GetDrawAreaAsHtml() публичный Метод

Gets the draw rectangle as HTML.
public GetDrawAreaAsHtml ( DrawArea drawArea ) : string
drawArea AODL.Document.Content.Draw.DrawArea The draw area.
Результат string
		public string GetDrawAreaAsHtml(DrawArea drawArea)
		{
			string html					= "<area shape=\"#type#\" coords=\"#coords#\" href=\"#link#\" target=\"_top\">\n";
			string coords				= null;
			int cx, cy, cxx, cyy, r		= 0;

			try
			{
				if (drawArea != null)
				{
					if (drawArea is DrawAreaRectangle)
					{
						html				= html.Replace("#link#", ((DrawAreaRectangle)drawArea).Href);
						
						cx					= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaRectangle)drawArea).X);
						cy					= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaRectangle)drawArea).Y);
						int w				= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaRectangle)drawArea).Width);
						int h				= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaRectangle)drawArea).Height);
						
						cxx					= cx+w;
						cyy					= cy+h;

						coords				= cx.ToString()+","+cy.ToString()+","+cxx.ToString()+","+cyy.ToString();
						html				= html.Replace("#coords#", coords);
						html				= html.Replace("#type#", "rect");
					}
					else if (drawArea is DrawAreaCircle)
					{
						html				= html.Replace("#link#", ((DrawAreaCircle)drawArea).Href);
						
						cx					= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaCircle)drawArea).CX);
						cy					= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaCircle)drawArea).CY);
						r					= SizeConverter.GetPixelFromAnOfficeSizeValue(
							((DrawAreaCircle)drawArea).Radius);

						coords				= cx.ToString()+","+cy.ToString()+","+r.ToString();
						html				= html.Replace("#coords#", coords);
						html				= html.Replace("#type#", "circle");
					}
				}
			}
			catch(Exception ex)
			{
				throw new AODLException("Exception while trying to build a HTML string from a ImageMap object.", ex);
			}

			return html;
		}