AODL.Document.TextDocuments.DocumentStyles.InsertHeader C# (CSharp) Method

InsertHeader() public method

Inserts the header.
public InsertHeader ( Paragraph content, TextDocument document ) : void
content AODL.Document.Content.Text.Paragraph The content.
document TextDocument The document.
return void
		public void InsertHeader(Paragraph content, TextDocument document)
		{
			bool exist			= true;
			XmlNode node		= this._styles.SelectSingleNode("//office:master-styles/style:master-page/style:header", document.NamespaceManager);//
			if (node != null)
				node.InnerXml	= "";
			else
			{
				node			= this.CreateNode("header", "style", document);
				exist			= false;
			}

			XmlNode	impnode		= this.Styles.ImportNode(content.Node, true);
			node.AppendChild(impnode);

			if (!exist)
				this._styles.SelectSingleNode("//office:master-styles/style:master-page",
				                              document.NamespaceManager).AppendChild(node);

			this.InsertParagraphStyle(content, document);
		}