CustomPropertiesPart

CustomPropertiesPart

概述

CustomPropertiesPart 是 Aspose.Slides FOSS 中用于 .NET 的类。

解析并序列化 docProps/custom.xml。每个自定义属性都以带类型的值存储(string、int、double、bool 或 DateTime)。PID 从 2 开始。仅在添加自定义属性时按需创建该文件。

此类提供 13 个方法,用于在 .NET 程序中处理 CustomPropertiesPart 对象。可用的方法包括:Clear、Contains、EnsureContentType、EnsureRelationship、GetName、GetValue、Parse、ParseFiletime、ReadValue、Remove、Save、SetValue,以及另外 1 个方法。安装 Aspose.Slides FOSS for .NET 包后,所有导出成员均可被任何 .NET 应用访问。属性:Count、PartName。

描述

CustomPropertiesPart 是 Aspose.Slides FOSS 库中用于 .NET 的类,提供 13 个方法和 2 个属性供编程使用。

该类还提供 Count 属性(获取计数),以及 PartName 属性(获取部件名称)。

属性

名称类型访问描述
Countint读取获取计数。
PartNamestring读取获取部件名称。

方法

签名描述
Contains(name: string)如果属性存在,则为 true;否则为 false。
Parse()解析包中的 docProps/custom.xml 部分。
ReadValue(propEl: XElement)已键入的值,如果未找到已识别的值类型,则为 null。
ParseFiletime(text: string?)已解析的 , 如果输入为 null、为空或无效,则为 null。
GetName(index: int)当索引超出范围时抛出。
GetValue(name: string)属性值,如果未找到则为 null。
SetValue(name: string, value: object)属性值(字符串、int、double、bool 或 DateTime)。
Remove(name: string)如果属性已被删除则为 true;如果属性不存在则为 false。
Clear()移除所有自定义属性。
Save()将自定义属性序列化回 OPC 包。仅在属性已被修改时写入。如果没有剩余属性,则移除该部件。
WriteValue(propEl: XElement, value: object)要写入的已键入值。
EnsureContentType()确保 [Content_Types].xml 对 docProps/custom.xml 有覆盖条目。
EnsureRelationship()确保 _rels/.rels 对 docProps/custom.xml 有关系条目。

另请参阅

 中文