ContentTypesManager
Overview
ContentTypesManager is a class in Aspose.Slides FOSS for .NET.
Manages the [Content_Types].xml file in an OPC package. Provides methods to parse existing content types, add overrides and default extensions, query content types for parts, and serialize back to XML.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
PartName | string | Read | Gets or sets the current part name being managed |
Methods
| Signature | Description |
|---|---|
Load() | Loads and parses the [Content_Types].xml from the package. If the part does not exist, creates a minimal structure with default extensions for .rels and .xml . |
AddDefaultExtension(extension: string, contentType: string) | The MIME content type to associate with the extension. |
AddOverride(partName: string, contentType: string) | The MIME content type. |
RemoveOverride(partName: string) | true if the override was removed; false if it did not exist. |
GetContentType(partName: string) | The content type string, or null if not found. |
Save() | Saves the content types back to the package as a well-formed XML document. |