AODL.Document.Content.Tables.Table.BuildNode C# (CSharp) Метод

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

Builds the node.
public BuildNode ( ) : XmlNode
Результат System.Xml.XmlNode
		public XmlNode BuildNode()
		{
			if (Forms.Count != 0)
			{
				XmlNode nodeForms = Node.SelectSingleNode("office:forms", this.Document.NamespaceManager);
				if (nodeForms == null)
				{
					nodeForms = this.Document.CreateNode("forms","office");
				}
				
				foreach (ODFForm f in Forms)
				{
					nodeForms.AppendChild(f.Node);
				}
				Node.AppendChild(nodeForms);
			}

			
			foreach( Column column in this.ColumnCollection)
				this.Node.AppendChild(column.Node);

			if (this.RowHeader != null)
				this.Node.AppendChild(this.RowHeader.Node);

			foreach (Row row in this.Rows)
			{
				//check for nested tables
				foreach(Cell cell in row.Cells)
				{
					foreach(IContent iContent in cell.Content)
					{
						if (iContent is Table)
						{
							Table table = iContent as Table;
							table.BuildNode();
						}
					}
				}
				//now, append the row node
				this.Node.AppendChild(row.Node);
			}

			return this.Node;
		}

Usage Example

Пример #1
0
        /// <summary>
        /// Builds the node.
        /// </summary>
        /// <returns></returns>
        public XmlNode BuildNode()
        {
            if (Forms.Count != 0)
            {
                XmlNode nodeForms = Node.SelectSingleNode("office:forms", this.Document.NamespaceManager);
                if (nodeForms == null)
                {
                    nodeForms = this.Document.CreateNode("forms", "office");
                }

                foreach (ODFForm f in Forms)
                {
                    nodeForms.AppendChild(f.Node);
                }
                Node.AppendChild(nodeForms);
            }


            foreach (Column column in this.ColumnCollection)
            {
                this.Node.AppendChild(column.Node);
            }

            if (this.RowHeader != null)
            {
                this.Node.AppendChild(this.RowHeader.Node);
            }

            foreach (Row row in this.Rows)
            {
                //check for nested tables
                foreach (Cell cell in row.Cells)
                {
                    foreach (IContent iContent in cell.Content)
                    {
                        if (iContent is Table)
                        {
                            Table table = iContent as Table;
                            table.BuildNode();
                        }
                    }
                }
                //now, append the row node
                this.Node.AppendChild(row.Node);
            }

            return(this.Node);
        }
All Usage Examples Of AODL.Document.Content.Tables.Table::BuildNode