Aspose::Words::Markup::IStructuredDocumentTag interface

IStructuredDocumentTag interface

Interface to define a common data for StructuredDocumentTag and StructuredDocumentTagRangeStart.

class IStructuredDocumentTag : public virtual System::Object

Methods

MethodDescription
virtual get_Appearance()Gets or sets the appearance of the structured document tag.
virtual get_Color()Gets or sets the color of the structured document tag.
virtual get_Id()Specifies a unique read-only persistent numerical Id for this SDT.
virtual get_IsMultiSection()Returns true if this instance is a ranged (multi-section) structured document tag.
virtual get_IsShowingPlaceholderText()Specifies whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT). if set to true, this state shall be resumed (showing placeholder text) upon opening this document.
virtual get_Level() constGets the level at which this SDT occurs in the document tree.
virtual get_LockContentControl()When set to true, this property will prohibit a user from deleting this SDT.
virtual get_LockContents()When set to true, this property will prohibit a user from editing the contents of this SDT.
virtual get_Node()Returns Node object that implements this interface.
virtual get_Placeholder()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.
virtual get_PlaceholderName()Gets or sets Name of the BuildingBlock containing placeholder text.
virtual get_SdtType()Gets type of this Structured document tag.
virtual get_Tag() constSpecifies a tag associated with the current SDT node. Can not be null.
virtual get_Title() constSpecifies the friendly name associated with this SDT. Can not be null.
virtual get_WordOpenXML()Gets a string that represents the XML contained within the node in the FlatOpc format.
virtual get_XmlMapping()Gets an object that represents the mapping of this structured document tag to XML data in a custom XML part of the current document.
virtual GetChildNodes(Aspose::Words::NodeType, bool)Returns a live collection of child nodes that match the specified types.
GetType() const override
Is(const System::TypeInfo&) const override
virtual RemoveSelfOnly()Removes just this SDT node itself, but keeps the content of it inside the document tree.
virtual set_Appearance(Aspose::Words::Markup::SdtAppearance)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_Appearance.
virtual set_Color(System::Drawing::Color)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_Color.
virtual set_IsShowingPlaceholderText(bool)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_IsShowingPlaceholderText.
virtual set_LockContentControl(bool)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_LockContentControl.
virtual set_LockContents(bool)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_LockContents.
virtual set_PlaceholderName(System::String)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_PlaceholderName.
virtual set_Tag(System::String)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_Tag.
virtual set_Title(System::String)Setter for Aspose::Words::Markup::IStructuredDocumentTag::get_Title.
static Type()

Examples

Shows how to remove structured document tag, but keeps content inside.

auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Structured document tags.docx");

// This collection provides a unified interface for accessing ranged and non-ranged structured tags.
System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Words::Markup::IStructuredDocumentTag>>> sdts = doc->get_Range()->get_StructuredDocumentTags()->LINQ_ToList();
ASSERT_EQ(5, sdts->LINQ_Count());

// Here we can get child nodes from the common interface of ranged and non-ranged structured tags.
for (auto&& sdt : System::IterateOver(sdts))
{
    if (sdt->GetChildNodes(Aspose::Words::NodeType::Any, false)->get_Count() > 0)
    {
        sdt->RemoveSelfOnly();
    }
}

sdts = doc->get_Range()->get_StructuredDocumentTags()->LINQ_ToList();
ASSERT_EQ(0, sdts->LINQ_Count());

See Also