private Paragraph ReadParagraphTextContent(Paragraph paragraph)
{
try
{
ArrayList mixedContent = new ArrayList();
foreach(XmlNode nodeChild in paragraph.Node.ChildNodes)
{
//Check for IText content first
TextContentProcessor tcp = new TextContentProcessor();
IText iText = tcp.CreateTextObject(this.Chart .Document, nodeChild.CloneNode(true));
if (iText != null)
mixedContent.Add(iText);
else
{
//Check against IContent
IContent iContent = this.CreateContent(nodeChild);
if (iContent != null)
mixedContent.Add(iContent);
}
}
//Remove all
paragraph.Node.InnerXml = "";
foreach(Object ob in mixedContent)
{
if (ob is IText)
{
XmlNode node=this.Chart.ChartDoc .ImportNode (((IText)ob).Node,true);
paragraph.Node.AppendChild(node);
}
else if (ob is IContent)
{
//paragraph.Content.Add(ob as IContent);
AddToCollection(ob as IContent, paragraph.Content);
}
else
{
if (this.OnWarning != null)
{
AODLWarning warning = new AODLWarning("Couldn't determine the type of a paragraph child node!.");
//warning.InMethod = AODLException.GetExceptionSourceInfo(new StackFrame(1, true));
warning.Node = paragraph.Node;
this.OnWarning(warning);
}
}
}
return paragraph;
}
catch(Exception ex)
{
throw new AODLException("Exception while trying to create the Paragraph content.", ex);
}
}