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

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

Gets the heading as HTML.
public GetHeadingAsHtml ( Header heading ) : string
heading AODL.Document.Content.Text.Header The heading.
Результат string
		public string GetHeadingAsHtml(Header heading)
		{
			string html					= "<p ";

			try
			{
				if (heading != null)
				{
					string style			= this.HTMLStyleBuilder.GetHeadingStyleAsHtml(heading);
					if (style.Length > 0)
					{
						html				+= style;
						html				+= ">\n";
					}
					else
						html				= html.Replace(" ", "")+">\n";

					
					string headerText		= "";
					string outlineLevel		= this.GetOutlineString(heading);

					string textContent		= this.GetITextCollectionAsHtml(heading.TextContent, null);
					if (textContent.Length > 0)
						headerText			+= textContent;
					
					//create an anchor
					html					+= "<a name=\""+headerText+"\">\n"+outlineLevel+" "+headerText+"\n</a>\n";
				}
			}
			catch(Exception ex)
			{
				throw new AODLException("Exception while trying to build a HTML string from a Heading object.", ex);
			}

			if (!html.Equals("<p "))
				html				+= "</p>\n";
			else
				html				= "";

			return html;
		}