ContentTypesManager

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.

This class provides 6 methods for working with ContentTypesManager objects in .NET programs. Available methods include: AddDefaultExtension, AddOverride, GetContentType, Load, RemoveOverride, Save. All exported members are accessible to any .NET application after installing the Aspose.Slides FOSS for .NET package. Properties: PartName.

Description

ContentTypesManager is a class in the Aspose.Slides FOSS library for .NET that exposes 6 methods and 1 property for programmatic use.

The class also provides the PartName property (gets the part name).

Properties

NameTypeAccessDescription
PartNamestringReadGets the part name.

Methods

SignatureDescription
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.

See Also