RelationshipsManager

RelationshipsManager

Overview

RelationshipsManager is a class in Aspose.Slides FOSS for .NET.

Manages relationships (.rels) files in an OPC package. Each part can have an associated .rels file that defines its relationships to other parts. This class provides methods to load, add, remove, and serialize relationships back to XML.

Properties

NameTypeAccessDescription
PartNamestringReadGets the part name (path) of the relationships file

Methods

SignatureDescription
RelationshipsManager(package: OpcPackage, sourcePart: string)Initializes a manager with an OPC package and source part path
GetRelsPartName(sourcePart: string)Gets the .rels file path for a given source part. The source part path. The corresponding .rels part path. "" → “_rels/.rels” “ppt/presentation.xml” → “ppt/_rels/presentation.xml.rels” “ppt/slides/slide1.xml” → “ppt/slides/_rels/slide1.xml.rels”
Load()Loads and parses the .rels file from the package.
ParseRelationships()Parses relationships from the loaded XML element.
GetRelationship(relId: string)The or null if not found.
GetRelationshipsByType(relType: string)A list of matching relationships.
GetAllRelationships()A list of all relationships.
GenerateRelId()A relationship ID not already in use.
AddRelationship(relType: string, target: string, relId: string?, targetMode: string?)The relationship ID.
RemoveRelationship(relId: string)true if removed; false if not found.
Save()Saves the relationships back to the package. If there are no relationships, the .rels part is deleted.

See Also