语言

StoryFragment 类

定义

表示 XPS 文档中故事的全部或部分内容。

public ref class StoryFragment
public ref class StoryFragment : System::Collections::Generic::IEnumerable<System::Windows::Documents::DocumentStructures::BlockElement ^>, System::Windows::Markup::IAddChild
public class StoryFragment
[System.Windows.Markup.ContentProperty("BlockElementList")]
public class StoryFragment : System.Collections.Generic.IEnumerable<System.Windows.Documents.DocumentStructures.BlockElement>, System.Windows.Markup.IAddChild
type StoryFragment = class
    interface IAddChild
[<System.Windows.Markup.ContentProperty("BlockElementList")>]
type StoryFragment = class
    interface IAddChild
    interface seq<BlockElement>
    interface IEnumerable
[<System.Windows.Markup.ContentProperty("BlockElementList")>]
type StoryFragment = class
    interface seq<BlockElement>
    interface IEnumerable
    interface IAddChild
Public Class StoryFragment
Public Class StoryFragment
Implements IAddChild, IEnumerable(Of BlockElement)
继承
StoryFragment
特性
实现

示例

下面的示例演示 <StoryFragment> XML 纸张规范 (XPS) 文档的一部分。

<StoryFragment StoryName="DocumentBody" FragmentType="Content">
  <SectionStructure>
    <ParagraphStructure>
      <NamedElement NameReference="Pg1Heading1" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P1" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P2" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P3" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P4" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P5" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1Heading2" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P6" />
    </ParagraphStructure>

    <ParagraphStructure>
      <NamedElement NameReference="Pg1P7" />
    </ParagraphStructure>

    <TableStructure>
      <TableRowGroupStructure>

        <TableRowStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R1C1P1" />
            </ParagraphStructure>
          </TableCellStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R1C2P1" />
            </ParagraphStructure>
          </TableCellStructure>
        </TableRowStructure>

        <TableRowStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R2C1P1" />
            </ParagraphStructure>
          </TableCellStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R2C2P1" />
            </ParagraphStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R2C2P2" />
            </ParagraphStructure>
          </TableCellStructure>
        </TableRowStructure>

        <TableRowStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R3C1P1" />
            </ParagraphStructure>
          </TableCellStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R3C2P1" />
            </ParagraphStructure>
          </TableCellStructure>
        </TableRowStructure>

        <TableRowStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R4C1P1" />
            </ParagraphStructure>
          </TableCellStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R4C2P1" />
            </ParagraphStructure>
          </TableCellStructure>
        </TableRowStructure>

        <TableRowStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R5C1P1" />
            </ParagraphStructure>
          </TableCellStructure>
          <TableCellStructure>
            <ParagraphStructure>
              <NamedElement NameReference="R5C2P1" />
            </ParagraphStructure>
          </TableCellStructure>
        </TableRowStructure>

      </TableRowGroupStructure>
    </TableStructure>
  </SectionStructure>
</StoryFragment>

注解

XPS 文档中的 XPS 故事大致类似于报纸或杂志中的故事。 它是文本和图形内容的段落,通常位于单个 XPS 文档中的单个主题上。 通常,它跨越多个页面,但它可能比一个页面短,如边栏 - 装箱的故事 - 在杂志。 故事也可以不连续,就像第四页继续的头版报纸故事一样。 因此,给定的页面可以有多个故事和多个故事的一部分。 页眉或页脚也是一种完全包含在单个页面上的特殊故事。

一个 StoryFragment 表示故事的所有或一部分。 它永远不能跨越多个页面,但它可以占据整个页面或与其他片段共享页面。 如果故事位于多个页面上,则每个页面上的每个部分都是一个单独的片段。 虽然故事可以有不连续的片段集,但任何片段本身都不能不连续。

只有一个 StoryFragments 元素才能是一个 StoryFragment. 的父级。 元素在元素StoryBreak中的位置StoryFragment指示故事是否包含在多个片段中,以及其他片段位于当前片段之前或之后。

当一StoryFragment些结构元素中间的结尾时,例如,<TableRowGroupStructure>XPS 文档生成应用程序必须在标记之前</TableRowGroupStructure>为元素(在本例</StoryFragment>中)插入适当的结束标记,即使结构在后面的片段中仍在继续。 (这是确保元素树内 StoryFragment 有效的 XML 所必需的。延续故事的片段必须以中断结构的开始标记开头。 必须以相同的方式处理中断结构的整个树(下面讨论过一个例外):必须为每个不匹配的起始标记添加中断点上方的结束标记。

当故事中断在标记之后 </TableCellStructure> 立即发生时,则生成应用程序必须在延续故事的片段中的相应点插入一个空表单元格结构(<TableCellStructure></TableCellStructure>)。 这是必需的,因此,使用需要合并给定故事的所有片段的应用程序可以使用简单的算法来执行此操作。

例如,假设应用程序想要将以下材料添加到 XPS 文档:

<SectionStructure>
   <TableStructure>
      <TableRowGroupStructure>
         <TableRowStructure>
            <TableCellStructure>
               <ParagraphStructure>
                  <NamedElement NameReference="SomeContent" />
               </ParagraphStructure>
            </TableCellStructure>
            <TableCellStructure>
               <ParagraphStructure>
                  <NamedElement NameReference="MoreContent" />
               </ParagraphStructure>
            </TableCellStructure>
         </TableRowStructure>
         <TableRowStructure>
            <TableCellStructure>
               <ParagraphStructure>
                  <NamedElement NameReference="EvenMoreContent" />
               </ParagraphStructure>
            </TableCellStructure>
            <TableCellStructure>
               <ParagraphStructure>
                  <NamedElement NameReference="LastContent" />
               </ParagraphStructure>
            </TableCellStructure>
         </TableRowStructure>
      </TableRowGroupStructure>
   </TableStructure>
</SectionStructure>

如果分页符在“SomeContent”之后 </TableCellStructure> 强制结束片段,则应用程序必须创建拆分,如以下示例所示:

<StoryFragment StoryName="MyStory" FragmentType="Content">
 <SectionStructure>
    <TableStructure>
       <TableRowGroupStructure>
          <TableRowStructure>
             <TableCellStructure>
                <ParagraphStructure>
                   <NamedElement NameReference="SomeContent" />
                </ParagraphStructure>
             </TableCellStructure>
<!-- lines from here to end of fragment added by producer-->
          </TableRowStructure>
       </TableRowGroupStructure>
    </TableStructure>
 </SectionStructure>
</StoryFragment>

<StoryFragment StoryName="MyStory" FragmentType="Content">
 <SectionStructure>
    <TableStructure>
       <TableRowGroupStructure>
          <TableRowStructure>
             <TableCellStructure>
              <!-- extra cell added by producer-->
             </TableCellStructure>
<!-- lines from here to start of fragment added by producer-->
             <TableCellStructure>
                <ParagraphStructure>
                   <NamedElement NameReference="MoreContent" />
                </ParagraphStructure>
             </TableCellStructure>
          </TableRowStructure>
          <TableRowStructure>
             <TableCellStructure>
                <ParagraphStructure>
                   <NamedElement NameReference="EvenMoreContent" />
                </ParagraphStructure>
             </TableCellStructure>
             <TableCellStructure>
                <ParagraphStructure>
                   <NamedElement NameReference="LastContent" />
                </ParagraphStructure>
             </TableCellStructure>
          </TableRowStructure>
       </TableRowGroupStructure>
    </TableStructure>
 </SectionStructure>
</StoryFragment>

读取文档的应用程序可能需要合并此内容。 例如,考虑将 “整个故事复制到剪贴板 ”按钮的 XPS 查看器;或将故事传递到语音合成器 的盲人应用程序的 XPS 。 阅读文档的某些应用程序可能需要合并文章片段的子集。 例如,一项通过三次单击将整个段落复制到剪贴板的功能需要在段落跨越分页符时执行合并,因为这样一个段落将在两 StoryFragment个 s 之间拆分。

若要合并,请使用以下算法:

  1. 从 </StoryFragment> 要合并的第一个片段的末尾删除并从第二个片段的开头删除 <StoryFragment> 。

  2. 如果第一个片段的最后一个结束标记的类型与第二个片段的第一个开始标记相同(而不是 <NamedElement> 标记),请删除它们。

  3. 重复步骤 2,直到这两个片段处于以下 任一 状态:

    • 尾随片段的第一个开始标记的最后一个结束标记之间不再存在类型匹配。
    • 前导片段的最后一个结束标记是尾随片段的第一个开始标记都是 <NamedElement> 标记。

在上面的示例中,如果生成应用程序未添加空单元格,则片段合并将生成一个表,其中第一行只包含一个包含“SomeContent”和“MoreContent”引用的单元格,而不是包含两个单元格的原始第一行,每个单元格包含单个引用

当整个故事被合并时,应针对属于同一故事的每个后续片段重复算法。 属于故事的片段在元素中 <Story> 编制索引。 请参阅可在 XPS 获取的 XML 纸张规范(XPS)规范的第 9.1.15 节 :规范和许可证下载。 给定故事的最后一个片段将有一个元素作为其最后一个 StoryBreak 子元素。

构造函数

名称 说明
StoryFragment()

初始化 StoryFragment 类的新实例。

属性

名称 说明
FragmentName

获取或设置故事片段的名称。

FragmentType

获取或设置片段的类型。

StoryName

获取或设置故事的名称。

方法

名称 说明
Add(BlockElement)

向故事片段添加块。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type。

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

显式接口实现

名称 说明
IAddChild.AddChild(Object)

此成员支持 .NET Framework 基础结构,不应直接从代码使用。

IAddChild.AddText(String)

将节点的文本内容添加到对象。

IEnumerable.GetEnumerator()

此方法尚未实现。

IEnumerable<BlockElement>.GetEnumerator()

此方法尚未实现。

扩展方法

名称 说明
Aggregate<TSource,TAccumulate,TResult>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, Func<TAccumulate,TResult>)

对序列应用累加器函数。 指定的种子值用作初始累加器值,并且指定函数用于选择结果值。

Aggregate<TSource,TAccumulate>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>)

对序列应用累加器函数。 指定的种子值用作初始累加器值。

Aggregate<TSource>(IEnumerable<TSource>, Func<TSource,TSource,TSource>)

对序列应用累加器函数。

All<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

确定序列的所有元素是否满足条件。

Ancestors<T>(IEnumerable<T>, XName)

返回一个筛选的元素集合,其中包含源集合中每个节点的上级。 集合中仅包含具有匹配 XName 的元素。

Ancestors<T>(IEnumerable<T>)

返回一个元素集合,其中包含源集合中每个节点的上级。

Any<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

确定序列的任何元素是否满足条件。

Any<TSource>(IEnumerable<TSource>)

确定序列是否包含任何元素。

Append<TSource>(IEnumerable<TSource>, TSource)

将值追加到序列的末尾。

AsEnumerable<TSource>(IEnumerable<TSource>)

返回类型化为 IEnumerable<T> 的输入。

AsParallel(IEnumerable)

启用查询的并行化。

AsParallel<TSource>(IEnumerable<TSource>)

启用查询的并行化。

AsQueryable(IEnumerable)

将 IEnumerable 转换为 IQueryable。

AsQueryable<TElement>(IEnumerable<TElement>)

将泛型 IEnumerable<T> 转换为泛型 IQueryable<T>。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

计算通过对输入序列的每个元素调用转换函数获得的 Decimal 值的序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

计算通过对输入序列的每个元素调用转换函数获得的 Double 值的序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

计算通过对输入序列的每个元素调用转换函数获得的 Int32 值的序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

计算通过对输入序列的每个元素调用转换函数获得的 Int64 值的序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

计算一系列可为 null 的 Decimal 值的平均值,这些值是通过对输入序列的每个元素调用转换函数获得的。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

计算一系列可为 null 的 Double 值的平均值,这些值是通过对输入序列的每个元素调用转换函数获得的。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

计算一系列可为 null 的 Int32 值的平均值,这些值是通过对输入序列的每个元素调用转换函数获得的。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

计算一系列可为 null 的 Int64 值的平均值,这些值是通过对输入序列的每个元素调用转换函数获得的。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

计算一系列可为 null 的 Single 值的平均值,这些值是通过对输入序列的每个元素调用转换函数获得的。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

计算通过对输入序列的每个元素调用转换函数获得的 Single 值的序列的平均值。

Cast<TResult>(IEnumerable)

将 IEnumerable 的元素强制转换为指定类型。

Concat<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

连接两个序列。

Contains<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)

确定序列是否使用指定的 IEqualityComparer<T>包含指定的元素。

Contains<TSource>(IEnumerable<TSource>, TSource)

使用默认相等比较器确定序列是否包含指定的元素。

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

给定泛型参数 DataRowDataTable的输入 IEnumerable<T> 对象,将 T 对象复制到指定的 DataRow。

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

给定泛型参数 DataRowDataTable的输入 IEnumerable<T> 对象,将 T 对象复制到指定的 DataRow。

CopyToDataTable<T>(IEnumerable<T>)

返回一个包含 DataTable 对象副本的 DataRow,给定 IEnumerable<T> 对象的输入 IEnumerable<T> 对象,其中泛型参数 DataRow。

Count<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回一个数字,该值代表指定序列中满足条件的元素数。

Count<TSource>(IEnumerable<TSource>)

返回序列中的元素数。

DefaultIfEmpty<TSource>(IEnumerable<TSource>, TSource)

如果序列为空,则返回指定序列的元素或单个实例集合中的指定值。

DefaultIfEmpty<TSource>(IEnumerable<TSource>)

如果序列为空,则返回指定序列的元素或类型参数在单一实例集合中的默认值。

DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。

Descendants<T>(IEnumerable<T>, XName)

返回一个筛选的元素集合,其中包含源集合中每个元素和文档的子代元素。 集合中仅包含具有匹配 XName 的元素。

Descendants<T>(IEnumerable<T>)

返回一个元素集合,其中包含源集合中每个元素和文档的子代元素。

Distinct<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

通过使用指定的 IEqualityComparer<T> 来比较值,从序列中返回不同的元素。

Distinct<TSource>(IEnumerable<TSource>)

通过使用默认相等比较器比较值,从序列中返回不同的元素。

ElementAt<TSource>(IEnumerable<TSource>, Int32)

返回序列中指定索引处的元素。

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Int32)

返回序列中指定索引处的元素;如果索引范围不足,则返回默认值。

Elements<T>(IEnumerable<T>, XName)

返回源集合中每个元素和文档的子元素的筛选集合。 集合中仅包含具有匹配 XName 的元素。

Elements<T>(IEnumerable<T>)

返回源集合中每个元素和文档的子元素的集合。

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

通过使用指定的 IEqualityComparer<T> 来比较值,生成两个序列的集差异。

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用默认相等比较器来比较值,生成两个序列的集差。

First<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回满足指定条件的序列中的第一个元素。

First<TSource>(IEnumerable<TSource>)

返回序列的第一个元素。

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回满足条件的序列的第一个元素;如果未找到此类元素,则返回默认值。

FirstOrDefault<TSource>(IEnumerable<TSource>)

返回序列的第一个元素;如果序列不包含任何元素,则返回默认值。

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)

根据指定的键选择器函数对序列的元素进行分组,并从每个组及其键创建结果值。 使用指定的比较器比较键值,并且每个组的元素都通过使用指定的函数进行投影。

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>,TResult>)

根据指定的键选择器函数对序列的元素进行分组,并从每个组及其键创建结果值。 每个组的元素是使用指定的函数投影的。

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根据键选择器函数对序列的元素进行分组。 通过使用比较器比较键,并且每个组的元素都通过使用指定的函数进行投影。

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根据指定的键选择器函数对序列的元素进行分组,并使用指定的函数投影每个组的元素。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>, IEqualityComparer<TKey>)

根据指定的键选择器函数对序列的元素进行分组,并从每个组及其键创建结果值。 使用指定的比较器比较键。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>)

根据指定的键选择器函数对序列的元素进行分组,并从每个组及其键创建结果值。

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根据指定的键选择器函数对序列的元素进行分组,并使用指定的比较器比较键。

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根据指定的键选择器函数对序列的元素进行分组。

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)

根据键相等性关联两个序列的元素,并对结果进行分组。 指定的 IEqualityComparer<T> 用于比较键。

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>)

根据键的相等性关联两个序列的元素,并对结果进行分组。 默认相等比较器用于比较键。

InDocumentOrder<T>(IEnumerable<T>)

返回一个节点集合,其中包含源集合中的所有节点,按文档顺序排序。

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

通过使用指定的 IEqualityComparer<T> 来比较值,生成两个序列的集交集。

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

通过使用默认相等比较器来比较值,生成两个序列的集交集。

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>, IEqualityComparer<TKey>)

根据匹配键关联两个序列的元素。 指定的 IEqualityComparer<T> 用于比较键。

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>)

根据匹配键关联两个序列的元素。 默认相等比较器用于比较键。

Last<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回满足指定条件的序列的最后一个元素。

Last<TSource>(IEnumerable<TSource>)

返回序列的最后一个元素。

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回满足条件的序列的最后一个元素;如果未找到此类元素,则返回默认值。

LastOrDefault<TSource>(IEnumerable<TSource>)

返回序列的最后一个元素;如果序列不包含任何元素,则返回默认值。

LongCount<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回表示序列中满足条件的元素数的 Int64。

LongCount<TSource>(IEnumerable<TSource>)

返回一个表示序列中元素总数的 Int64。

Max<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

对泛型序列的每个元素调用转换函数,并返回得到的最大值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

对序列的每个元素调用转换函数,并返回最大 Decimal 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

对序列的每个元素调用转换函数,并返回最大 Double 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

对序列的每个元素调用转换函数,并返回最大 Int32 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

对序列的每个元素调用转换函数,并返回最大 Int64 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

对序列的每个元素调用转换函数,并返回最大可为 null Decimal 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

对序列的每个元素调用转换函数,并返回最大可为 null Double 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

对序列的每个元素调用转换函数,并返回最大可为 null Int32 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

对序列的每个元素调用转换函数,并返回最大可为 null Int64 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

对序列的每个元素调用转换函数,并返回最大可为 null Single 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

对序列的每个元素调用转换函数,并返回最大 Single 值。

Max<TSource>(IEnumerable<TSource>)

返回泛型序列中的最大值。

Min<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

对泛型序列的每个元素调用转换函数,并返回生成的最小值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

对序列的每个元素调用转换函数,并返回最小 Decimal 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

对序列的每个元素调用转换函数,并返回最小 Double 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

对序列的每个元素调用转换函数,并返回最小 Int32 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

对序列的每个元素调用转换函数,并返回最小 Int64 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

对序列的每个元素调用转换函数,并返回可为 null 的最小 Decimal 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

对序列的每个元素调用转换函数,并返回可为 null 的最小 Double 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

对序列的每个元素调用转换函数,并返回可为 null 的最小 Int32 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

对序列的每个元素调用转换函数,并返回可为 null 的最小 Int64 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

对序列的每个元素调用转换函数,并返回可为 null 的最小 Single 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

对序列的每个元素调用转换函数,并返回最小 Single 值。

Min<TSource>(IEnumerable<TSource>)

返回泛型序列中的最小值。

Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点的集合。

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

使用指定的比较器按升序对序列的元素进行排序。

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根据键按升序对序列的元素进行排序。

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

使用指定的比较器按降序对序列的元素进行排序。

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根据键按降序对序列的元素进行排序。

Prepend<TSource>(IEnumerable<TSource>, TSource)

将值添加到序列的开头。

Remove<T>(IEnumerable<T>)

从源集合的父节点中删除每个节点。

Reverse<TSource>(IEnumerable<TSource>)

反转序列中元素的顺序。

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,TResult>)

通过合并元素的索引,将序列的每个元素投影到一个新窗体中。

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

将序列的每个元素投影到一个新窗体中。

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

将序列的每个元素投影到 IEnumerable<T>,将生成的序列平展为一个序列,并在其中的每个元素上调用结果选择器函数。

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

将序列的每个元素投影到 IEnumerable<T>,将生成的序列平展为一个序列,并在其中的每个元素上调用结果选择器函数。 每个源元素的索引用于该元素的中间投影形式。

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TResult>>)

将序列的每个元素投影到 IEnumerable<T>,并将生成的序列平展为一个序列。

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TResult>>)

将序列的每个元素投影到 IEnumerable<T>,并将生成的序列平展为一个序列。 每个源元素的索引用于该元素的投影形式。

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

通过使用指定的 IEqualityComparer<T>,确定两个序列是否相等。

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

通过使用其类型的默认相等比较器,确定两个序列是否相等。

Single<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回满足指定条件的序列的唯一元素,如果存在多个此类元素,则会引发异常。

Single<TSource>(IEnumerable<TSource>)

返回序列的唯一元素,如果序列中没有完全有一个元素,则会引发异常。

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

返回满足指定条件的序列的唯一元素;如果没有此类元素,则返回默认值;如果多个元素满足条件,此方法将引发异常。

SingleOrDefault<TSource>(IEnumerable<TSource>)

返回序列的唯一元素;如果序列为空,则返回默认值;如果序列中有多个元素,此方法将引发异常。

Skip<TSource>(IEnumerable<TSource>, Int32)

绕过序列中的指定数量的元素,然后返回其余元素。

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

只要指定条件为 true,即可绕过序列中的元素,然后返回其余元素。

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定条件为 true,即可绕过序列中的元素,然后返回其余元素。 元素的索引用于谓词函数的逻辑。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

计算通过对输入序列的每个元素调用转换函数获得的 Decimal 值序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

计算通过对输入序列的每个元素调用转换函数获得的 Double 值序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

计算通过对输入序列的每个元素调用转换函数获得的 Int32 值序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

计算通过对输入序列的每个元素调用转换函数获得的 Int64 值序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

计算通过对输入序列的每个元素调用转换函数获取的可为 null Decimal 值的序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

计算通过对输入序列的每个元素调用转换函数获取的可为 null Double 值的序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

计算通过对输入序列的每个元素调用转换函数获取的可为 null Int32 值的序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

计算通过对输入序列的每个元素调用转换函数获取的可为 null Int64 值的序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

计算通过对输入序列的每个元素调用转换函数获取的可为 null Single 值的序列的总和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

计算通过对输入序列的每个元素调用转换函数获得的 Single 值序列的总和。

Take<TSource>(IEnumerable<TSource>, Int32)

从序列的开头返回指定的连续元素数。

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

只要指定的条件为 true,就从序列中返回元素。

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定的条件为 true,就从序列中返回元素。 元素的索引用于谓词函数的逻辑。

ToArray<TSource>(IEnumerable<TSource>)

从 IEnumerable<T>创建数组。

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根据指定的键选择器函数、比较器和元素选择器函数从 Dictionary<TKey,TValue> 创建 IEnumerable<T>。

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根据指定的键选择器和元素选择器函数从 Dictionary<TKey,TValue> 创建 IEnumerable<T>。

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根据指定的键选择器函数和键比较器从 Dictionary<TKey,TValue> 创建 IEnumerable<T>。

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根据指定的键选择器函数从 Dictionary<TKey,TValue> 创建 IEnumerable<T>。

ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

使用 HashSet<T> 比较键从 IEnumerable<T> 创建 comparer。

ToHashSet<TSource>(IEnumerable<TSource>)

从 HashSet<T>创建 IEnumerable<T>。

ToList<TSource>(IEnumerable<TSource>)

从 List<T>创建 IEnumerable<T>。

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根据指定的键选择器函数、比较器和元素选择器函数从 Lookup<TKey,TElement> 创建 IEnumerable<T>。

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根据指定的键选择器和元素选择器函数从 Lookup<TKey,TElement> 创建 IEnumerable<T>。

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根据指定的键选择器函数和键比较器从 Lookup<TKey,TElement> 创建 IEnumerable<T>。

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根据指定的键选择器函数从 Lookup<TKey,TElement> 创建 IEnumerable<T>。

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T>生成两个序列的集并集。

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用默认相等比较器生成两个序列的集并集。

Where<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

根据谓词筛选值序列。

Where<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

根据谓词筛选值序列。 每个元素的索引都在谓词函数的逻辑中使用。

Zip<TFirst,TSecond,TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)

将指定的函数应用于两个序列的相应元素,从而生成结果序列。

适用于

另请参阅