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

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

Gets the mixed content as HTML.
public GetMixedContentAsHTML ( ArrayList mixedContent, ParagraphStyle paragraphStyle ) : string
mixedContent System.Collections.ArrayList ArrayList of objects. The objects could be /// IContent or IText.
paragraphStyle AODL.Document.Styles.ParagraphStyle The paragraph style.
Результат string
		public string GetMixedContentAsHTML(ArrayList mixedContent, ParagraphStyle paragraphStyle)
		{
			string html					= "";
			int tabStopCnt				= 0;

			try
			{
				if (mixedContent != null)
				{
					foreach(object ob in mixedContent)
					{
						//determine type text content types
						if (ob is SimpleText)
						{
							html			+= this.ReplaceControlNodes(((IText)ob).Node.InnerText);
						}
						else if (ob is FormatedText)
							html			+= this.GetFormatedTextAsHtml(ob as FormatedText);
						else if (ob is WhiteSpace)
							html			+= this.GetWhiteSpacesAsHtml(ob as WhiteSpace);
						else if (ob is TabStop)
						{
							html			+= this.GetTabStopAsHtml(ob as TabStop, tabStopCnt, html, paragraphStyle);
							tabStopCnt++;
						}
						else if (ob is XLink)
							html			+= this.GetXLinkAsHtml(ob as XLink);
						else if (ob is LineBreak)
							html			+= this.GetLineBreakAsHtml();
						else if (ob is UnknownTextContent)
							html			+= this.GetUnknowTextContentAsHtml(ob as UnknownTextContent);
							//determine type
						else if (ob is Table)
							html			+= this.GetTableAsHtml(ob as Table);
						else if (ob is Paragraph)
							html			+= this.GetParagraphAsHtml(ob as Paragraph);
						else if (ob is List)
							html			+= this.GetListAsHtml(ob as List);
						else if (ob is Frame)
							html			+= this.GetDrawFrameAsHtml(ob as Frame);
						else if (ob is Graphic)
							html			+= this.GetGraphicAsHtml(ob as Graphic);
						else if (ob is ListItem)
							html			+= this.GetListItemAsHtml(ob as ListItem);
						else if (ob is Field)
							html			+= this.GetFieldAsHtml(ob as Field);
						else if (ob is ODFControlRef)
							html			+= this.GetODFControlAsHtml(ob as ODFControlRef);
						else if (ob is Header)
							html			+= this.GetHeadingAsHtml(ob as Header);
						else if (ob is UnknownContent)
							html			+= this.GetUnknowContentAsHtml(ob as UnknownContent);
						else
							//this should never happens, because all not implemented elements 
							//are unknwon content
							if (OnWarning != null)
						{
							AODLWarning warning			= new AODLWarning("Finding total unknown content in mixed content. This should (could) never happen.");
							//warning.InMethod			= AODLException.GetExceptionSourceInfo(new StackFrame(1, true));
							OnWarning(warning);
						}
					}
				}
			}
			catch(Exception ex)
			{
				throw new AODLException("Exception while trying to build a HTML string from an ITextCollection.", ex);
			}

			return html;			
		}