private void Content_Inserted(int index, object value)
{
if (value is Graphic)
{
if (((Graphic)value).Frame == null)
{
((Graphic)value).Frame = this;
if (((Graphic)value).GraphicRealPath != null
&& this.GraphicSourcePath == null)
this.GraphicSourcePath = ((Graphic)value).GraphicRealPath;
this.Node.AppendChild(((IContent)value).Node);
}
if (((IContent)value).Node != null)
{
if (((IContent)value).Node.ParentNode == null
|| !((IContent)value).Node.ParentNode.Equals(this.Node))
{
this.Node.AppendChild(((IContent)value).Node);
}
}
}
else if (value is EmbedObject )
{
if (((EmbedObject)value).ObjectType =="chart")
{
if (this.Document.IsLoadedFile&&!((Chart)value).IsNewed )
{
this.Node .AppendChild (((Chart)value).ParentNode );
}
else
{
string objectLink = "."+@"/"+((EmbedObject)value).ObjectName;
this.Node .AppendChild (((Chart)value).CreateParentNode (objectLink) );
}
}
}
else
{
if (((IContent)value).Node != null)
{
if (((IContent)value).Node.ParentNode == null
|| !((IContent)value).Node.ParentNode.Equals(this.Node))
{
this.Node.AppendChild(((IContent)value).Node);
}
}
}
}