DocumentBase Class

Provides the abstract base class for a main document and a glossary document of a Word document.
Inheritance Hierarchy

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public abstract class DocumentBase : CompositeNode

The DocumentBase type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleBackgroundShape
Gets or sets the background shape of the document. Can be null.
Public propertyCode exampleChildNodes
Gets all immediate child nodes of this node.
(Inherited from CompositeNode.)
Public propertyCode exampleCount
Gets the number of immediate children of this node.
(Inherited from CompositeNode.)
Public propertyDocument (Overrides NodeDocument.)
Public propertyCode exampleFirstChild
Gets the first child of the node.
(Inherited from CompositeNode.)
Public propertyCode exampleFontInfos
Provides access to properties of fonts used in this document.
Public propertyCode exampleHasChildNodes
Returns true if this node has any child nodes.
(Inherited from CompositeNode.)
Public propertyCode exampleIsComposite
Returns true as this node can have child nodes.
(Inherited from CompositeNode.)
Public propertyCode exampleLastChild
Gets the last child of the node.
(Inherited from CompositeNode.)
Public propertyCode exampleLists
Provides access to the list formatting used in the document.
Public propertyCode exampleNextSibling
Gets the node immediately following this node.
(Inherited from Node.)
Public propertyCode exampleNodeChangingCallback
Called when a node is inserted or removed in the document.
Public propertyCode exampleNodeType
Gets the type of this node.
(Inherited from Node.)
Public propertyCode examplePageColor
Gets or sets the page color of the document. This property is a simpler version of BackgroundShape.
Public propertyCode exampleParentNode
Gets the immediate parent of this node.
(Inherited from Node.)
Public propertyCode examplePreviousSibling
Gets the node immediately preceding this node.
(Inherited from Node.)
Public propertyCode exampleRange
Returns a Range object that represents the portion of a document that is contained in this node.
(Inherited from Node.)
Public propertyCode exampleResourceLoadingCallback
Allows to control how external resources are loaded.
Public propertyCode exampleStyles
Returns a collection of styles defined in the document.
Public propertyCode exampleWarningCallback
Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss.
Methods
  NameDescription
Public methodCode exampleAccept
Accepts a visitor.
(Inherited from Node.)
Public methodCode exampleAppendChild
Adds the specified node to the end of the list of child nodes for this node.
(Inherited from CompositeNode.)
Public methodCode exampleClone (Inherited from Node.)
Public methodEquals (Inherited from Object.)
Public methodCode exampleGetAncestor(Type)
Gets the first ancestor of the specified object type.
(Inherited from Node.)
Public methodCode exampleGetAncestor(NodeType)
Gets the first ancestor of the specified NodeType.
(Inherited from Node.)
Public methodCode exampleGetChild
Returns an Nth child node that matches the specified type.
(Inherited from CompositeNode.)
Public methodCode exampleGetChildNodes
Returns a live collection of child nodes that match the specified type.
(Inherited from CompositeNode.)
Public methodCode exampleGetEnumerator
Provides support for the for each style iteration over the child nodes of this node.
(Inherited from CompositeNode.)
Public methodGetHashCode (Inherited from Object.)
Public methodCode exampleGetText
Gets the text of this node and of all its children.
(Inherited from CompositeNode.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleImportNode(Node, Boolean)

Imports a node from another document to the current document.

Public methodCode exampleImportNode(Node, Boolean, ImportFormatMode)

Imports a node from another document to the current document with an option to control formatting.

Public methodCode exampleIndexOf
Returns the index of the specified child node in the child node array.
(Inherited from CompositeNode.)
Public methodCode exampleInsertAfter
Inserts the specified node immediately after the specified reference node.
(Inherited from CompositeNode.)
Public methodCode exampleInsertBefore
Inserts the specified node immediately before the specified reference node.
(Inherited from CompositeNode.)
Public methodCode exampleNextPreOrder
Gets next node according to the pre-order tree traversal algorithm.
(Inherited from Node.)
Public methodCode examplePrependChild
Adds the specified node to the beginning of the list of child nodes for this node.
(Inherited from CompositeNode.)
Public methodCode examplePreviousPreOrder
Gets the previous node according to the pre-order tree traversal algorithm.
(Inherited from Node.)
Public methodCode exampleRemove
Removes itself from the parent.
(Inherited from Node.)
Public methodCode exampleRemoveAllChildren
Removes all the child nodes of the current node.
(Inherited from CompositeNode.)
Public methodCode exampleRemoveChild
Removes the specified child node.
(Inherited from CompositeNode.)
Public methodCode exampleRemoveSmartTags
Removes all SmartTag descendant nodes of the current node.
(Inherited from CompositeNode.)
Public methodCode exampleSelectNodes
Selects a list of nodes matching the XPath expression.
(Inherited from CompositeNode.)
Public methodCode exampleSelectSingleNode
Selects the first Node that matches the XPath expression.
(Inherited from CompositeNode.)
Public methodToString (Inherited from Object.)
Public methodCode exampleToString(SaveFormat)
Exports the content of the node into a string in the specified format.
(Inherited from Node.)
Public methodCode exampleToString(SaveOptions)
Exports the content of the node into a string using the specified save options.
(Inherited from Node.)
Remarks

Aspose.Words represents a Word document as a tree of nodes. DocumentBase is a root node of the tree that contains all other nodes of the document.

DocumentBase also stores document-wide information such as Styles and Lists that the tree nodes might refer to.

Examples
Shows how to initialize the subclasses of DocumentBase.
// DocumentBase is the abstract base class for the Document and GlossaryDocument classes
Document doc = new Document();

GlossaryDocument glossaryDoc = new GlossaryDocument();
doc.GlossaryDocument = glossaryDoc;
See Also

Reference

Aspose.WordsDocumentBase