StructuredDocumentTag
Overview
StructuredDocumentTag is a class in Aspose.Words FOSS for .NET.
Inherits from: CompositeNode, IMarkupNode, ITrackableNode, and 2 more.
Represents a structured document tag (SDT or content control) in a document.
This class provides 31 methods for working with StructuredDocumentTag objects in .NET programs.
Available methods include: Accept, AcceptEnd, AcceptStart, AppendChild, Clear, Clone, CreateNavigator, GetAncestor, GetAncestorOf, GetChild, GetChildNodes, GetEnumerator, and 19 additional methods.
All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package.
Properties: Appearance, BuildingBlockCategory, BuildingBlockGallery, CalendarType, Checked, Color, and 38 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
NodeType | NodeType | Read | Returns StructuredDocumentTag. |
Placeholder | BuildingBlock | Read | Gets the BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty, the associated mapped XML element is empty as specified via the XmlMapping element or the IsShowingPlaceholderText element is true. |
PlaceholderName | string | Read/Write | Gets or sets Name of the BuildingBlock containing placeholder text. |
Level | MarkupLevel | Read | Gets the level at which this SDT occurs in the document tree. |
SdtType | SdtType | Read | Gets type of this Structured document tag. |
Id | int | Read | Specifies a unique read-only persistent numerical Id for this SDT. |
LockContentControl | bool | Read/Write | When set to true, this property will prohibit a user from deleting this SDT. |
LockContents | bool | Read/Write | When set to true, this property will prohibit a user from editing the contents of this SDT. |
IsShowingPlaceholderText | bool | Read/Write | Specifies whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT). |
Tag | string | Read/Write | Specifies a tag associated with the current SDT node. |
ContentsFont | Font | Read | Font formatting that will be applied to text entered into SDT. |
EndCharacterFont | Font | Read | Font formatting that will be applied to the last character of text entered into SDT. |
IsTemporary | bool | Read/Write | Specifies whether this SDT shall be removed from the WordProcessingML document when its contents are modified. |
Title | string | Read/Write | Specifies the friendly name associated with this SDT. |
ListItems | SdtListItemCollection | Read | Gets SdtListItemCollection associated with this SDT. |
Checked | bool | Read/Write | Gets/Sets current state of the Checkbox SDT. |
Appearance | SdtAppearance | Read/Write | Gets/sets the appearance of a structured document tag. |
DateDisplayLocale | int | Read/Write | Allows to set/get the language format for the date displayed in this SDT. |
DateDisplayFormat | string | Read/Write | String that represents the format in which dates are displayed. |
FullDate | DateTime | Read/Write | Specifies the full date and time last entered into this SDT. |
DateStorageFormat | SdtDateStorageFormat | Read/Write | Gets/sets format in which the date for a date SDT is stored when the SDT is bound to an XML node in the document’s data store. |
CalendarType | SdtCalendarType | Read/Write | Specifies the type of calendar for this SDT. |
BuildingBlockGallery | string | Read/Write | Specifies type of building block for this SDT. |
BuildingBlockCategory | string | Read/Write | Specifies category of building block for this SDT node. |
Multiline | bool | Read/Write | Specifies whether this SDT allows multiple lines of text. |
Color | System.Drawing.Color | Read/Write | Gets or sets the color of the structured document tag. |
Style | Style | Read/Write | Gets or sets the Style of the structured document tag. |
StyleName | string | Read/Write | Gets or sets the name of the style applied to the structured document tag. |
XmlMapping | XmlMapping | Read | Gets an object that represents the mapping of this structured document tag to XML data in a custom XML part of the current document. |
WordOpenXML | string | Read | Gets a string that represents the XML contained within the node in the FlatOpc format. |
WordOpenXMLMinimal | string | Read | Gets a string that represents the XML contained within the node in the FlatOpc format. |
IsComposite | bool | Read | Returns true as this node can have child nodes. |
HasChildNodes | bool | Read | Returns true if this node has any child nodes. |
FirstChild | Node | Read | Gets the first child of the node. |
LastChild | Node | Read | Gets the last child of the node. |
Count | int | Read | Gets the number of immediate children of this node. |
ParentNode | CompositeNode | Read | Gets the immediate parent of this node. |
Document | DocumentBase | Read | Gets the document to which this node belongs. |
PreviousSibling | Node | Read | Gets the node immediately preceding this node. |
NextSibling | Node | Read | Gets the node immediately following this node. |
Range | Range | Read | Returns a Range object that represents the portion of a document that is contained in this node. |
CustomNodeId | int | Read/Write | Specifies custom node identifier. |
IsMultiSection | bool | Read | Returns true if this instance is a ranged (multi-section) structured document tag. |
Node | Node | Read | Returns Node object that implements this interface. |
Methods
| Signature | Description |
|---|---|
StructuredDocumentTag(doc: DocumentBase, type: SdtType, level: MarkupLevel) | Initializes a new instance of the Structured document tag class. |
SetCheckedSymbol(characterCode: int, fontName: string) | Sets the symbol used to represent the checked state of a check box content control. |
SetUncheckedSymbol(characterCode: int, fontName: string) | Sets the symbol used to represent the unchecked state of a check box content control. |
RemoveSelfOnly() | Removes just this SDT node itself, but keeps the content of it inside the document tree. |
Accept(visitor: DocumentVisitor) | Calls VisitStructuredDocumentTagStart, then calls Accept for all child nodes of the smart tag and calls VisitStructuredDocumentTagEnd at the end. |
Clear() | Clears contents of this structured document tag and displays a placeholder if it is defined. |
AcceptStart(visitor: DocumentVisitor) | Accepts a visitor for visiting the start of the StructuredDocumentTag. |
AcceptEnd(visitor: DocumentVisitor) | Accepts a visitor for visiting the end of the StructuredDocumentTag. |
GetText() | Gets the text of this node and of all its children. |
GetChildNodes(nodeType: NodeType, isDeep: bool) | Returns a collection of child nodes that match the specified type. |
GetChild(nodeType: NodeType, index: int, isDeep: bool) | Returns an Nth child node that matches the specified type. |
SelectNodes(xpath: string) | Selects a list of nodes matching the XPath expression. |
SelectSingleNode(xpath: string) | Selects the first Node that matches the XPath expression. |
GetEnumerator() | Provides support for the for each style iteration over the child nodes of this node. |
AppendChild(newChild: T) | Adds the specified node to the end of the list of child nodes for this node. |
PrependChild(newChild: T) | Adds the specified node to the beginning of the list of child nodes for this node. |
InsertAfter(newChild: T, refChild: Node) | Inserts the specified node immediately after the specified reference node. |
InsertBefore(newChild: T, refChild: Node) | Inserts the specified node immediately before the specified reference node. |
RemoveChild(oldChild: T) | Removes the specified child node. |
RemoveAllChildren() | Removes all the child nodes of the current node. |
RemoveSmartTags() | Removes all SmartTag descendant nodes of the current node. |
IndexOf(child: Node) | Returns the index of the specified child node in the child node array. |
CreateNavigator() | Creates navigator which can be used to traverse and read nodes. |
Clone(isCloneChildren: bool) | You should use the Clone(bool, INodeCloningListener) overload when the node cloning is a part of another (usually composite) node cloning process. |
GetAncestor(ancestorType: Type) | Gets the first ancestor of the specified object type. |
GetAncestorOf() | Calls GetAncestorOf on this StructuredDocumentTag instance. |
Remove() | Removes itself from the parent. |
NextPreOrder(rootNode: Node) | Gets next node according to the pre-order tree traversal algorithm. |
PreviousPreOrder(rootNode: Node) | Gets the previous node according to the pre-order tree traversal algorithm. |
ToString(saveFormat: SaveFormat) | Exports the content of the node into a string in the specified format. |
NodeTypeToString(nodeType: NodeType) | A utility method that converts a node type enum value into a user friendly string. |