Share via


SharedItems 类

定义

定义 SharedItems 类。

此类在 Office 2007 及更高版本中可用。

当对象序列化为 xml 时,其限定名称为 x:sharedItems。

[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.MissingItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.NumberItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BooleanItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ErrorItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.StringItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DateTimeItem))]
[DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)]
[DocumentFormat.OpenXml.SchemaAttr(22, "sharedItems")]
public class SharedItems : DocumentFormat.OpenXml.OpenXmlCompositeElement
public class SharedItems : DocumentFormat.OpenXml.OpenXmlCompositeElement
[DocumentFormat.OpenXml.SchemaAttr(22, "sharedItems")]
public class SharedItems : DocumentFormat.OpenXml.OpenXmlCompositeElement
[DocumentFormat.OpenXml.SchemaAttr("x:sharedItems")]
public class SharedItems : DocumentFormat.OpenXml.OpenXmlCompositeElement
[DocumentFormat.OpenXml.SchemaAttr("x:sharedItems")]
public class SharedItems : DocumentFormat.OpenXml.TypedOpenXmlCompositeElement
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.MissingItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.NumberItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BooleanItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ErrorItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.StringItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DateTimeItem))]
public class SharedItems : DocumentFormat.OpenXml.OpenXmlCompositeElement
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.MissingItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.NumberItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BooleanItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ErrorItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.StringItem))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DateTimeItem))]
[DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)]
public class SharedItems : DocumentFormat.OpenXml.OpenXmlCompositeElement
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.MissingItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.NumberItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BooleanItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ErrorItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.StringItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DateTimeItem))>]
[<DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)>]
[<DocumentFormat.OpenXml.SchemaAttr(22, "sharedItems")>]
type SharedItems = class
    inherit OpenXmlCompositeElement
type SharedItems = class
    inherit OpenXmlCompositeElement
[<DocumentFormat.OpenXml.SchemaAttr(22, "sharedItems")>]
type SharedItems = class
    inherit OpenXmlCompositeElement
[<DocumentFormat.OpenXml.SchemaAttr("x:sharedItems")>]
type SharedItems = class
    inherit OpenXmlCompositeElement
[<DocumentFormat.OpenXml.SchemaAttr("x:sharedItems")>]
type SharedItems = class
    inherit TypedOpenXmlCompositeElement
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.MissingItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.NumberItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BooleanItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ErrorItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.StringItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DateTimeItem))>]
type SharedItems = class
    inherit OpenXmlCompositeElement
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.MissingItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.NumberItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BooleanItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ErrorItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.StringItem))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DateTimeItem))>]
[<DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)>]
type SharedItems = class
    inherit OpenXmlCompositeElement
Public Class SharedItems
Inherits OpenXmlCompositeElement
Public Class SharedItems
Inherits TypedOpenXmlCompositeElement
继承
继承
属性

注解

[ISO/IEC 29500-1 第 1 版]

sharedItems (共享项)

表示 PivotCacheDefinition 中字段的唯一项的集合。 sharedItems 复杂类型在字段中存储有关数据的数据类型和格式信息。 可以共享 PivotCacheDefinition 中的项,以减少跨所有数据透视表部件在多个位置引用的这些值的冗余。 [示例:值可能是筛选器的一部分,它可能显示在行轴或列轴上,并且也将显示在 pivotCacheRecords 定义中。 但是,由于创建优化共享项的性能成本,只有在数据透视表中实际使用项时,才会共享这些项。 因此,根据用户对数据透视表布局的操作,可以更新 pivotCacheDefinition 和基础 PivotCacheRecords 部件。 示例结束]

如果没有共享项,则字段值直接存储在 pivotCacheRecords 部件中。

[示例:

<sharedItems count="1">  
  <s v="[Customer].[Customer Geography].[Country].&[United States]"     c="United States"/>  
</sharedItems>  

示例结束]

如果 sharedItems 中没有项,则不需要或使用以下属性。

  • containsBlank

  • containsSemiMixedTypes

  • containsMixedTypes

  • longText

除非 sharedItems 中有多个项,或者只有一项不是空白项,否则不会使用以下属性。 如果第一项为空项,则无法验证字段的数据类型。

  • containsNumber

  • containsDates

  • containsString

  • containsInteger

可以在不丢失功能的情况下省略以下属性。

  • containsNonDate

  • count

以下属性不是必需的,可以省略。 但是,刷新数据透视表可能会生成与以前不同的分组。

  • maxDate

  • minDate

  • maxValue

  • minValue

应用程序应确保“date”属性不与“值”属性混合。

父元素
cacheField (§18.10.1.3)
子元素
b (布尔) §18.10.1.2
d (日期时间) §18.10.1.21
e (错误值) §18.10.1.27
m (无值) §18.10.1.50
n (数值) §18.10.1.60
s (字符值) §18.10.1.85
属性 说明
containsBlank (包含空白) 指定一个布尔值,该值指示此字段是否包含空白值。

值为 1true 表示此字段包含一个或多个空白值。

值为 0false 表示此字段不包含空白值。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsDate (包含日期) 指定一个布尔值,该值指示字段至少包含一个日期。

值为 1true 表示字段至少包含一个日期值。

值为 0false 表示字段不包含任何日期值。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsInteger (包含整数) 指定一个布尔值,该值指示此字段是否包含整数值。

值为 1true 表示此字段包含整数值。

值为 0false 表示非整数值或混合值。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsMixedTypes (包含混合数据类型) 指定一个布尔值,该值指示此字段是否包含多个数据类型。

值为 1true 表示此字段包含多个数据类型。

值为 0false 表示仅包含一种数据类型。 字段仍可以包含空白值。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsNonDate (包含非日期) 指定一个布尔值,该值指示字段至少包含一个不是日期的值。

值为 1true 表示字段至少包含一个非日期值。

值为 0false 表示此字段不包含日期字段。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsNumber (包含数字) 指定一个布尔值,该值指示此字段是否包含数值。

值为 1true 表示此字段至少包含一个数值。

值为 0false 表示此字段不包含数值。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsSemiMixedTypes (包含半混合数据类型) 指定一个布尔值,该值指示此字段包含文本值。 字段还可以包含其他数据类型和空白值的混合。

值为 1true 表示至少一个文本值,还可以包含其他数据类型和空白值的混合。

如果值为 0false ,则表示字段没有文本和其他值的混合。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
containsString (包含字符串) 指定一个布尔值,该值指示此字段是否包含文本值。

值为 1true 表示此字段至少包含一个文本值。

值为 0false 表示此字段不包含任何文本值。

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
计数 (共享项计数) 指定要为此字段加载的共享项数。

此属性的可能值由 W3C XML 架构 unsignedInt 数据类型定义。
longText (长文本) 指定一个布尔值,该值指示此字段是否包含长文本值。 如果字符串超过 255 个字符,则将其视为长字符串。

值为 1true 表示该值包含超过 255 个字符的文本。

值为 0false 表示该值包含的字符少于 255 个字符。

[注意:由于许多旧电子表格应用程序支持文本值限制 255 个字符,因此使用此方法。 注释结束]

此属性可能的值由 W3C XML 架构 boolean 数据类型定义。
maxDate (最大日期时间值) 指定在日期字段中找到的最大日期/时间值。

此属性的可能值由 W3C XML Schema dateTime 数据类型定义。
maxValue (最大值) 指定在数值字段中找到的最大数值。

此属性的可能值由 W3C XML 架构 双数据类型 定义。
minDate (最短日期时间) 指定在日期字段中找到的最小日期/时间值。

此属性的可能值由 W3C XML Schema dateTime 数据类型定义。
minValue (最小值) 指定在数值字段中找到的最小数值。

此属性的可能值由 W3C XML 架构 双数据类型 定义。

[注意:此元素的内容模型 (CT_SharedItems) 的 W3C XML 架构定义位于 §A.2 中。 注释结束]

ISO/IEC29500:2008。

构造函数

SharedItems()

初始化 SharedItems 类的新实例。

SharedItems(IEnumerable<OpenXmlElement>)

使用指定的子元素初始化 SharedItems 类的新实例。

SharedItems(OpenXmlElement[])

使用指定的子元素初始化 SharedItems 类的新实例。

SharedItems(String)

从外部 XML 初始化 SharedItems 类的新实例。

属性

ChildElements

获取当前元素的所有子节点。

(继承自 OpenXmlElement)
ContainsBlank

包含空白

表示架构中的以下属性:containsBlank

ContainsDate

包含日期

表示架构中的以下属性:containsDate

ContainsInteger

包含整数

表示架构中的以下属性:containsInteger

ContainsMixedTypes

包含混合数据类型

表示架构中的以下属性:containsMixedTypes

ContainsNonDate

包含非日期

表示架构中的以下属性:containsNonDate

ContainsNumber

包含数字

表示架构中的以下属性:containsNumber

ContainsSemiMixedTypes

包含半混合数据类型

表示架构中的以下属性:containsSemiMixedTypes

ContainsString

包含字符串

表示架构中的以下属性:containsString

Count

共享项计数

表示架构中的以下属性:count

ExtendedAttributes

获取当前元素的架构) 中未定义的所有扩展属性 (属性。

(继承自 OpenXmlElement)
Features

IFeatureCollection获取当前元素的 。 此功能集合将是只读的,但会从其父部件和包继承功能(如果可用)。

(继承自 OpenXmlElement)
FirstChild

获取当前 OpenXmlElement 元素的第一个子元素。

(继承自 OpenXmlCompositeElement)
HasAttributes

获取一个值,该值指示当前元素是否具有任何属性。

(继承自 OpenXmlElement)
HasChildren

获取一个值,该值指示当前元素是否具有任何子元素。

(继承自 OpenXmlCompositeElement)
InnerText

获取或设置当前节点及其所有子节点的串联值。

(继承自 OpenXmlCompositeElement)
InnerXml

获取或设置仅表示当前节点的子节点的标记。

(继承自 OpenXmlCompositeElement)
LastChild

获取当前 OpenXmlElement 元素的最后一个子元素。 如果没有这样的 OpenXmlElement 元素,则返回 null (Visual Basic) Nothing。

(继承自 OpenXmlCompositeElement)
LocalName

定义 SharedItems 类。

此类在 Office 2007 及更高版本中可用。

当对象序列化为 xml 时,其限定名称为 x:sharedItems。

LocalName

获取当前元素的本地名称。

(继承自 OpenXmlElement)
LongText

长文本

表示架构中的以下属性:longText

MaxDate

最大日期时间值

表示架构中的以下属性:maxDate

MaxValue

最大数值

表示架构中的以下属性:maxValue

MCAttributes

获取或设置标记兼容性属性。 如果未为当前元素定义标记兼容性属性,则返回 null。

(继承自 OpenXmlElement)
MinDate

最小日期时间

表示架构中的以下属性:minDate

MinValue

最小值

表示架构中的以下属性:minValue

NamespaceDeclarations

获取在当前元素中定义的所有命名空间声明。 如果没有命名空间声明,则返回空枚举器。

(继承自 OpenXmlElement)
NamespaceUri

获取当前元素的命名空间 URI。

(继承自 OpenXmlElement)
OpenXmlElementContext

获取当前元素的 OpenXmlElementContext。

(继承自 OpenXmlElement)
OuterXml

获取表示当前元素及其所有子元素的标记。

(继承自 OpenXmlElement)
Parent

获取当前元素的父元素。

(继承自 OpenXmlElement)
Prefix

获取当前元素的命名空间前缀。

(继承自 OpenXmlElement)
XmlQualifiedName

获取当前元素的限定名称。

(继承自 OpenXmlElement)
XName

获取当前元素的限定名称。

(继承自 OpenXmlElement)

方法

AddAnnotation(Object)

将 对象添加到当前 OpenXmlElement 元素的批注列表中。

(继承自 OpenXmlElement)
AddChild(OpenXmlElement, Boolean)

如果指定元素是已知的子元素,则将其添加到 元素。 这会根据架构将 元素添加到正确的位置。

(继承自 OpenXmlCompositeElement)
AddNamespaceDeclaration(String, String)

将命名空间声明添加到当前节点。

(继承自 OpenXmlElement)
Ancestors()

枚举当前元素的所有上级。

(继承自 OpenXmlElement)
Ancestors<T>()

仅枚举具有指定类型的当前元素的上级。

(继承自 OpenXmlElement)
Annotation(Type)

从当前 OpenXmlElement 元素获取指定类型的第一个批注对象。

(继承自 OpenXmlElement)
Annotation<T>()

从当前 OpenXmlElement 元素获取指定类型的第一个批注对象。

(继承自 OpenXmlElement)
Annotations(Type)

获取具有当前 OpenXmlElement 元素的指定类型的批注的集合。

(继承自 OpenXmlElement)
Annotations<T>()

获取具有当前 OpenXmlElement 元素的指定类型的批注的集合。

(继承自 OpenXmlElement)
Append(IEnumerable<OpenXmlElement>)

将元素列表中的每个元素追加到当前元素的子元素列表的末尾。

(继承自 OpenXmlElement)
Append(OpenXmlElement[])

将元素数组中的每个元素追加到当前元素的子元素列表的末尾。

(继承自 OpenXmlElement)
AppendChild<T>(T)

将指定的元素追加到当前元素的子节点列表的末尾。

(继承自 OpenXmlCompositeElement)
ClearAllAttributes()

清除所有属性,包括已知属性和扩展属性。

(继承自 OpenXmlElement)
Clone()

创建当前节点的副本。

(继承自 OpenXmlElement)
CloneNode(Boolean)

创建此节点的副本。

Descendants()

枚举当前元素的所有后代。

(继承自 OpenXmlElement)
Descendants<T>()

枚举类型为 T 的当前元素的所有后代。

(继承自 OpenXmlElement)
Elements()

枚举当前元素的所有子元素。

(继承自 OpenXmlElement)
Elements<T>()

仅枚举具有指定类型的当前元素的子元素。

(继承自 OpenXmlElement)
ElementsAfter()

枚举与当前元素相同的父级的所有同级元素。

(继承自 OpenXmlElement)
ElementsBefore()

枚举当前元素之前且具有与当前元素相同的父级的所有同级元素。

(继承自 OpenXmlElement)
GetAttribute(String, String)

获取具有指定标记名称和命名空间 URI 的 Open XML 属性。

(继承自 OpenXmlElement)
GetAttributes()

获取一个列表,该列表包含所有属性的副本。

(继承自 OpenXmlElement)
GetEnumerator()

返回循环访问子集合的枚举器。

(继承自 OpenXmlElement)
GetFirstChild<T>()

查找类型 T 中的第一个子元素。

(继承自 OpenXmlElement)
InsertAfter<T>(T, OpenXmlElement)

在指定的引用元素之后立即插入指定的元素。

(继承自 OpenXmlCompositeElement)
InsertAfterSelf<T>(T)

在当前元素之后立即插入指定的元素。

(继承自 OpenXmlElement)
InsertAt<T>(T, Int32)

在当前元素的子元素的指定索引处插入指定的元素。

(继承自 OpenXmlCompositeElement)
InsertBefore<T>(T, OpenXmlElement)

将指定的元素紧接在指定的引用元素之前。

(继承自 OpenXmlCompositeElement)
InsertBeforeSelf<T>(T)

将指定的元素紧接在当前元素的前面。

(继承自 OpenXmlElement)
IsAfter(OpenXmlElement)

确定当前元素是否以文档顺序显示在指定元素之后。

(继承自 OpenXmlElement)
IsBefore(OpenXmlElement)

确定当前元素是否按文档顺序显示在指定元素之前。

(继承自 OpenXmlElement)
LookupNamespace(String)

解析当前节点上下文中的命名空间前缀。

(继承自 OpenXmlElement)
LookupPrefix(String)

查找当前元素范围内命名空间 URI 的相应前缀。

(继承自 OpenXmlElement)
NextSibling()

获取紧跟在当前 OpenXmlElement 元素后面的 OpenXmlElement 元素。 如果没有下一个 OpenXmlElement 元素,则返回 null (Visual Basic) Nothing。

(继承自 OpenXmlElement)
NextSibling<T>()

获取具有当前 OpenXmlElement 元素后面的指定类型的 OpenXmlElement 元素。 如果没有下一个 OpenXmlElement,则返回 null (Visual Basic) Nothing。

(继承自 OpenXmlElement)
PrependChild<T>(T)

在当前元素的子节点列表的开头插入指定的元素。

(继承自 OpenXmlCompositeElement)
PreviousSibling()

获取紧接在当前 OpenXmlElement 元素之前的 OpenXmlElement 元素。 如果没有前面的 OpenXmlElement 元素,则返回 null (Visual Basic ) 中 Nothing。

(继承自 OpenXmlElement)
PreviousSibling<T>()

获取位于当前 OpenXmlElement 之前的指定类型的 OpenXmlElement 元素。 如果没有前面的 OpenXmlElement 元素,则返回 null (Visual Basic) Nothing。

(继承自 OpenXmlElement)
Remove()

从其父元素中删除当前元素。

(继承自 OpenXmlElement)
RemoveAllChildren()

删除当前元素的所有子元素。

(继承自 OpenXmlCompositeElement)
RemoveAllChildren<T>()

删除类型为 T 的当前元素的所有子元素。

(继承自 OpenXmlElement)
RemoveAnnotations(Type)

从当前 OpenXmlElement 元素中删除指定类型的注释。

(继承自 OpenXmlElement)
RemoveAnnotations<T>()

从当前 OpenXmlElement 元素中删除具有指定类型的批注。

(继承自 OpenXmlElement)
RemoveAttribute(String, String)

从当前元素中删除 属性。

(继承自 OpenXmlElement)
RemoveChild<T>(T)

删除指定的子元素。

(继承自 OpenXmlCompositeElement)
RemoveNamespaceDeclaration(String)

删除指定前缀的命名空间声明。 如果没有前缀,则不删除任何内容。

(继承自 OpenXmlElement)
ReplaceChild<T>(OpenXmlElement, T)

将当前元素的子元素之一替换为另一个 OpenXmlElement 元素。

(继承自 OpenXmlCompositeElement)
SetAttribute(OpenXmlAttribute)

将特性设置为指定的元素。 如果该属性是已知属性,则设置该特性的值。 如果该属性是扩展属性,则会将“openxmlAttribute”添加到扩展属性列表中。

(继承自 OpenXmlElement)
SetAttributes(IEnumerable<OpenXmlAttribute>)

设置元素的多个属性。 如果属性是已知属性,则会设置该属性的值。 如果属性是扩展属性,则会将“openxmlAttribute”添加到扩展属性列表中。

(继承自 OpenXmlElement)
WriteTo(XmlWriter)

将当前节点保存到指定的 XmlWriter。

(继承自 OpenXmlElement)

显式接口实现

IEnumerable.GetEnumerator()

定义 SharedItems 类。

此类在 Office 2007 及更高版本中可用。

当对象序列化为 xml 时,其限定名称为 x:sharedItems。

(继承自 OpenXmlElement)
IEnumerable<OpenXmlElement>.GetEnumerator()

返回循环访问子集合的枚举器。

(继承自 OpenXmlElement)

适用于