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.
This class provides 11 methods for working with RelationshipsManager objects in .NET programs.
Available methods include: AddRelationship, GenerateRelId, GetAllRelationships, GetRelationship, GetRelationshipsByType, GetRelsPartName, Load, ParseRelationships, RelationshipsManager, RemoveRelationship, Save.
All exported members are accessible to any .NET application after installing the Aspose.Slides FOSS for .NET package.
Properties: PartName.
Description
RelationshipsManager is a class in the Aspose.Slides FOSS library for .NET that exposes 10 methods and 1 property for programmatic use.
The class also provides the PartName property (gets the part name).
Instances are created through a single constructor that initializes the object with default values.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
PartName | string | Read | Gets the part name. |
Methods
| Signature | Description |
|---|---|
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. |