FreezableCollection<T> 类

定义

表示 DependencyObjectFreezableAnimatable 对象的集合。 FreezableCollection<T> 本身是 Animatable 类型。

generic <typename T>
 where T : DependencyObjectpublic ref class FreezableCollection : System::Windows::Media::Animation::Animatable, System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IList<T>, System::Collections::IList, System::Collections::Specialized::INotifyCollectionChanged, System::ComponentModel::INotifyPropertyChanged
public class FreezableCollection<T> : System.Windows.Media.Animation.Animatable, System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged where T : DependencyObject
type FreezableCollection<'T (requires 'T :> DependencyObject)> = class
    inherit Animatable
    interface IList
    interface ICollection
    interface IList<'T (requires 'T :> DependencyObject)>
    interface ICollection<'T (requires 'T :> DependencyObject)>
    interface seq<'T (requires 'T :> DependencyObject)>
    interface IEnumerable
    interface INotifyCollectionChanged
    interface INotifyPropertyChanged
type FreezableCollection<'T (requires 'T :> DependencyObject)> = class
    inherit Animatable
    interface IList
    interface ICollection
    interface IEnumerable
    interface IList<'T (requires 'T :> DependencyObject)>
    interface ICollection<'T (requires 'T :> DependencyObject)>
    interface seq<'T (requires 'T :> DependencyObject)>
    interface INotifyCollectionChanged
    interface INotifyPropertyChanged
type FreezableCollection<'T (requires 'T :> DependencyObject)> = class
    inherit Animatable
    interface ICollection<'T (requires 'T :> DependencyObject)>
    interface seq<'T (requires 'T :> DependencyObject)>
    interface IEnumerable
    interface IList<'T (requires 'T :> DependencyObject)>
    interface ICollection
    interface IList
    interface INotifyCollectionChanged
    interface INotifyPropertyChanged
Public Class FreezableCollection(Of T)
Inherits Animatable
Implements ICollection(Of T), IEnumerable(Of T), IList, IList(Of T), INotifyCollectionChanged, INotifyPropertyChanged

类型参数

T

集合的类型。 此类型必须是 DependencyObject 或派生类。

继承
派生
实现

注解

提供此类用于创建完全支持数据绑定、更改通知、属性无效及其内容的动画的自定义集合类型。

FreezableCollection 的 XAML 用法

FreezableCollection<T> 支持有限的 XAML 语法。

  • 作为根中的对象元素,理论上可以指定不受约束 FreezableCollection<T> 的对象元素,该元素还必须指定 x:TypeArguments 指令 来声明约束。 但是,这不是一个常见方案,因为要执行此操作, FreezableCollection<T> 必须是根元素。 存在此限制是因为 WPF 中的 XAML 处理器实现仅支持 x:TypeArguments 指令 ,而设置它的元素是根元素,并且如果要在 XAML 中实例化泛型类型,则必须在任何打开的约束泛型上使用。 你不太可能希望 将 作为 FreezableCollection<T> 根元素,即使作为松散的 XAML 也是如此。

  • 如果派生自 FreezableCollection<T> 派生集合并在派生集合中应用类型约束,则派生集合可以支持各种用法。 这是可能的,因为派生中的约束无需传递 。

    • 此类派生集合的典型 XAML 用法是通过隐式集合语法。 支持某些接口的集合不需要将集合本身指定为对象元素。 有关 XAML 中的集合语法的详细信息,请参阅 XAML 语法详细信息。 例如,具有 属性的类型受 约束DependencyObject对象的FreezableCollection<T>对象可以支持以下语法:

      <object>  
        <object.property>  
          oneOrMoreDependencyObjectElements  
        </object.property>  
      </object>  
      
    • 只要不隐藏无参数构造函数,派生集合也可以支持对象元素语法 (对象元素是显式的,而不是上述) 所示的隐式用法。 它不需要是根元素。 或者,也可以使用派生集合作为根元素,而无需指定 ,尽管将集合用作根元素并不常见。

  • 在上述任一方案中,集合的任何子元素的类型都必须是已实现的约束或 指定的。

构造函数

FreezableCollection<T>()

初始化 FreezableCollection<T> 的新实例,该实例为空并且具有默认初始容量。

FreezableCollection<T>(IEnumerable<T>)

初始化 FreezableCollection<T> 类的新实例,该实例包含与指定集合相同的元素。

FreezableCollection<T>(Int32)

初始化 FreezableCollection<T> 的新实例,该实例为空并且具有指定的初始容量。

属性

CanFreeze

获取一个值,该值指示是否可将对象变为不可修改。

(继承自 Freezable)
Count

获取此 FreezableCollection<T> 包含的元素数。

DependencyObjectType

获取 DependencyObjectType 包装此实例的 CLR 类型的 。

(继承自 DependencyObject)
Dispatcher

获取与此 Dispatcher 关联的 DispatcherObject

(继承自 DispatcherObject)
HasAnimatedProperties

获取一个值,该值指示一个或多个 AnimationClock 对象是否与此对象的任何依赖项属性相关联。

(继承自 Animatable)
IsFrozen

获取一个值,该值指示对象当前是否可修改。

(继承自 Freezable)
IsSealed

获取一个值,该值指示此实例当前是否为密封的(只读)。

(继承自 DependencyObject)
Item[Int32]

获取或设置指定索引处的元素。

方法

Add(T)

将指定对象添加到 FreezableCollection<T> 的结尾。

ApplyAnimationClock(DependencyProperty, AnimationClock)

AnimationClock 应用到指定的 DependencyProperty。 如果该属性已进行动画处理,则使用 SnapshotAndReplace 切换行为。

(继承自 Animatable)
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

AnimationClock 应用到指定的 DependencyProperty。 如果该属性已进行动画处理,则使用指定的 HandoffBehavior

(继承自 Animatable)
BeginAnimation(DependencyProperty, AnimationTimeline)

将动画应用于指定 DependencyProperty。 动画会在呈现下一帧时启动。 如果指定属性已进行动画处理,则使用 SnapshotAndReplace 切换行为。

(继承自 Animatable)
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

将动画应用于指定 DependencyProperty。 动画会在呈现下一帧时启动。 如果指定的属性已进行动画处理,则使用指定的 HandoffBehavior

(继承自 Animatable)
CheckAccess()

确定调用线程是否可以访问此 DispatcherObject

(继承自 DispatcherObject)
Clear()

从集合中删除所有元素。

ClearValue(DependencyProperty)

清除属性的本地值。 要清除的属性由 DependencyProperty 标识符指定。

(继承自 DependencyObject)
ClearValue(DependencyPropertyKey)

清除只读属性的本地值。 要清除的属性由 DependencyPropertyKey 指定。

(继承自 DependencyObject)
Clone()

创建此 FreezableCollection<T> 及其内容的可修改复本,从而制作深层副本。 如果此集合(或其内容)具有经过动画处理的依赖项属性,则会复制属性的基值,但不会复制其经过动画处理的当前值。

CloneCore(Freezable)

使用基(未经过动画处理的)属性值使此实例成为指定的 FreezableCollection<T> 的复本(深层副本)。

CloneCurrentValue()

创建此 FreezableCollection<T> 及其内容的可修改副本,从而制作此对象的当前值的深层副本。 如果此对象(或其包含的对象)包含经过动画处理的依赖项属性,则会复制这些属性经过动画处理的当前值。

CloneCurrentValueCore(Freezable)

使用当前的属性值使该实例成为指定的 FreezableCollection<T> 的可修改复本(深层副本)。

CoerceValue(DependencyProperty)

对指定依赖属性的值进行强制。 通过对调用方 DependencyObject 上存在的依赖属性的属性元数据中所指定的任何 CoerceValueCallback 函数进行调用来完成此操作。

(继承自 DependencyObject)
Contains(T)

确定此 FreezableCollection<T> 是否包含指定值。

CopyTo(T[], Int32)

从目标数组的指定索引处开始,将整个 FreezableCollection<T> 复制到兼容的一维数组。

CreateInstance()

初始化 Freezable 类的新实例。

(继承自 Freezable)
CreateInstanceCore()

创建 FreezableCollection<T> 的新实例。

Equals(Object)

确定提供的 DependencyObject 是否等效于当前 DependencyObject

(继承自 DependencyObject)
Freeze()

使当前对象不可修改,并且将其 IsFrozen 属性设置为 true

(继承自 Freezable)
FreezeCore(Boolean)

使此 FreezableCollection<T> 对象成为不可修改的对象,或确定是否可使其成为不可修改的对象。

GetAnimationBaseValue(DependencyProperty)

返回指定的 DependencyProperty 的未经过动画处理的值。

(继承自 Animatable)
GetAsFrozen()

使用基(未经过动画处理的)属性值创建 Freezable 的冻结副本。 由于副本已冻结,因此将通过引用复制任何冻结的子对象。

(继承自 Freezable)
GetAsFrozenCore(Freezable)

使用基(未经过动画处理的)属性值使此实例成为指定 FreezableCollection<T> 的冻结复本。

GetCurrentValueAsFrozen()

使用当前属性值创建 Freezable 的冻结副本。 由于副本已冻结,因此将通过引用复制任何冻结的子对象。

(继承自 Freezable)
GetCurrentValueAsFrozenCore(Freezable)

使此实例成为指定 Freezable 的冻结复本。 如果此对象具有经过动画处理的依赖项属性,则会复制这些属性经过动画处理的当前值。

GetEnumerator()

返回用于整个 FreezableCollection<T> 的枚举数。

GetHashCode()

获取此 DependencyObject 的哈希代码。

(继承自 DependencyObject)
GetLocalValueEnumerator()

创建一个专用的枚举数,用于确定哪些依赖项属性在此 DependencyObject 上具有以本地方式设置的值。

(继承自 DependencyObject)
GetType()

获取当前实例的 Type

(继承自 Object)
GetValue(DependencyProperty)

DependencyObject 的此实例返回依赖属性的当前有效值。

(继承自 DependencyObject)
IndexOf(T)

搜索指定的对象,并返回整个 FreezableCollection<T> 中第一个匹配项的从零开始的索引。

Insert(Int32, T)

将指定对象插入到 FreezableCollection<T> 中的指定索引位置。

InvalidateProperty(DependencyProperty)

重新评估指定依赖属性的有效值。

(继承自 DependencyObject)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
OnChanged()

修改当前 Freezable 对象时调用。

(继承自 Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject)

确保为刚刚设置的 DependencyObjectType 数据成员建立适当的上下文指针。

(继承自 Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)

此成员支持Windows Presentation Foundation (WPF) 基础结构,不应直接从代码中使用。

(继承自 Freezable)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

重写 OnPropertyChanged(DependencyPropertyChangedEventArgs)DependencyObject 实现,以同时调用任何响应类型 Freezable 不断变化的依赖属性的 Changed 处理程序。

(继承自 Freezable)
ReadLocalValue(DependencyProperty)

如果存在,则返回依赖属性的本地值。

(继承自 DependencyObject)
ReadPreamble()

确保正在从有效的线程访问 FreezableFreezable 的继承者必须在任何 API 一开始读取不属于依赖项对象的数据成员时调用此方法。

(继承自 Freezable)
Remove(T)

FreezableCollection<T> 中删除指定对象的第一个匹配项。

RemoveAt(Int32)

FreezableCollection<T> 中从零开始的指定索引处移除对象。

SetCurrentValue(DependencyProperty, Object)

设置依赖属性的值而不更改其值源。

(继承自 DependencyObject)
SetValue(DependencyProperty, Object)

设置依赖属性的本地值,该值由其依赖属性标识符指定。

(继承自 DependencyObject)
SetValue(DependencyPropertyKey, Object)

设置一个只读依赖属性的本地值,该值由依赖属性的 DependencyPropertyKey 标识符指定。

(继承自 DependencyObject)
ShouldSerializeProperty(DependencyProperty)

返回一个值,该值指示序列化进程是否应序列化所提供的依赖属性的值。

(继承自 DependencyObject)
ToString()

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

(继承自 Object)
VerifyAccess()

强制调用线程具有此 DispatcherObject 的访问权限。

(继承自 DispatcherObject)
WritePostscript()

引发 FreezableChanged 事件并调用其 OnChanged() 方法。 从 Freezable 派生的类应在修改的类成员不存储为依赖属性的任何 API 的末尾调用此方法。

(继承自 Freezable)
WritePreamble()

验证 Freezable 是否未被冻结,并且是否正在从有效的线程上下文中访问它。 Freezable 的继承项应当在任何 API 一开始写入不属于依赖项属性的数据成员时调用此方法。

(继承自 Freezable)

事件

Changed

在修改 Freezable 或其包含的对象时发生。

(继承自 Freezable)

显式接口实现

ICollection.CopyTo(Array, Int32)

有关此成员的说明,请参见 CopyTo(Array, Int32)

ICollection.IsSynchronized

有关此成员的说明,请参见 IsSynchronized

ICollection.SyncRoot

有关此成员的说明,请参见 SyncRoot

ICollection<T>.IsReadOnly

有关此成员的说明,请参见 IsReadOnly

IEnumerable.GetEnumerator()

有关此成员的说明,请参见 GetEnumerator()

IEnumerable<T>.GetEnumerator()

有关此成员的说明,请参见 GetEnumerator()

IList.Add(Object)

有关此成员的说明,请参见 Add(Object)

IList.Contains(Object)

有关此成员的说明,请参见 Contains(Object)

IList.IndexOf(Object)

有关此成员的说明,请参见 IndexOf(Object)

IList.Insert(Int32, Object)

有关此成员的说明,请参见 Insert(Int32, Object)

IList.IsFixedSize

有关此成员的说明,请参见 IsFixedSize

IList.IsReadOnly

有关此成员的说明,请参见 IsReadOnly

IList.Item[Int32]

有关此成员的说明,请参见 Item[Int32]

IList.Remove(Object)

有关此成员的说明,请参见 Remove(Object)

INotifyCollectionChanged.CollectionChanged

有关此成员的说明,请参见 CollectionChanged

INotifyPropertyChanged.PropertyChanged

有关此成员的说明,请参见 PropertyChanged

扩展方法

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRow

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

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRow

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

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRow

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

对序列应用累加器函数。

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

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

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

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

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

表示 DependencyObjectFreezableAnimatable 对象的集合。 FreezableCollection<T> 本身是 Animatable 类型。

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TKey,TAccumulate>, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

表示 DependencyObjectFreezableAnimatable 对象的集合。 FreezableCollection<T> 本身是 Animatable 类型。

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

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

Any<TSource>(IEnumerable<TSource>)

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

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

确定序列中是否存在任意一个元素满足条件。

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

将一个值追加到序列末尾。

AsEnumerable<TSource>(IEnumerable<TSource>)

返回类型化为 IEnumerable<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 的元素强制转换为指定的类型。

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

将序列的元素拆分为最多 size大小的区块。

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

连接两个序列。

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

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

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

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

Count<TSource>(IEnumerable<TSource>)

返回序列中的元素数量。

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

返回表示在指定的序列中满足条件的元素数量的数字。

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

表示 DependencyObjectFreezableAnimatable 对象的集合。 FreezableCollection<T> 本身是 Animatable 类型。

DefaultIfEmpty<TSource>(IEnumerable<TSource>)

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

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

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

Distinct<TSource>(IEnumerable<TSource>)

通过使用默认的相等比较器对值进行比较,返回序列中的非重复元素。

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

通过使用指定的 IEqualityComparer<T> 对值进行比较,返回序列中的非重复元素。

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

根据指定的键选择器函数从序列中返回不同的元素。

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

根据指定的键选择器函数返回序列中的不同元素,并使用指定的比较器比较键。

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

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

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

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

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

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

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

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

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

通过使用默认的相等比较器对值进行比较,生成两个序列的差集。

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

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

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

根据指定的键选择器函数生成两个序列的集差。

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

根据指定的键选择器函数生成两个序列的集差。

First<TSource>(IEnumerable<TSource>)

返回序列中的第一个元素。

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

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

FirstOrDefault<TSource>(IEnumerable<TSource>)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,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,TResult>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)

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

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

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

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

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

Index<TSource>(IEnumerable<TSource>)

表示 DependencyObjectFreezableAnimatable 对象的集合。 FreezableCollection<T> 本身是 Animatable 类型。

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

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

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

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

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

根据指定的键选择器函数生成两个序列的集交集。

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

根据指定的键选择器函数生成两个序列的集交集。

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

基于匹配键对两个序列的元素进行关联。 使用默认的相等比较器对键进行比较。

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

基于匹配键对两个序列的元素进行关联。 使用指定的 IEqualityComparer<T> 对键进行比较。

Last<TSource>(IEnumerable<TSource>)

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

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

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

LastOrDefault<TSource>(IEnumerable<TSource>)

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

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

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

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

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

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

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

LongCount<TSource>(IEnumerable<TSource>)

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

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

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

Max<TSource>(IEnumerable<TSource>)

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

Max<TSource>(IEnumerable<TSource>, IComparer<TSource>)

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

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,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

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

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

根据指定的键选择器函数返回泛型序列中的最大值。

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

根据指定的键选择器函数和键比较器返回泛型序列中的最大值。

Min<TSource>(IEnumerable<TSource>)

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

Min<TSource>(IEnumerable<TSource>, IComparer<TSource>)

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

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,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

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

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

根据指定的键选择器函数返回泛型序列中的最小值。

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

根据指定的键选择器函数和键比较器返回泛型序列中的最小值。

OfType<TResult>(IEnumerable)

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

Order<T>(IEnumerable<T>)

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

Order<T>(IEnumerable<T>, IComparer<T>)

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

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

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

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

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

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

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

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

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

OrderDescending<T>(IEnumerable<T>)

按降序对序列的元素排序。

OrderDescending<T>(IEnumerable<T>, IComparer<T>)

按降序对序列的元素排序。

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

向序列的开头添加值。

Reverse<TSource>(IEnumerable<TSource>)

反转序列中元素的顺序。

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

将序列中的每个元素投影到新表单。

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

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

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

将序列的每个元素投影到 IEnumerable<T> 并将结果序列合并为一个序列。

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

将序列的每个元素投影到 IEnumerable<T> 并将结果序列合并为一个序列。 每个源元素的索引用于该元素的投影表。

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>,并将结果序列合并为一个序列,并对其中每个元素调用结果选择器函数。 每个源元素的索引用于该元素的中间投影表。

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

通过使用相应类型的默认相等比较器对序列的元素进行比较,以确定两个序列是否相等。

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

通过使用指定的 IEqualityComparer<T> 来比较两个序列的元素,以确定这两个序列是否相等。

Single<TSource>(IEnumerable<TSource>)

返回序列的唯一元素;如果该序列并非恰好包含一个元素,则会引发异常。

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

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

SingleOrDefault<TSource>(IEnumerable<TSource>)

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

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

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

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

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

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

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

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

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

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

返回一个新的可枚举集合,它包含 source 中的元素,但省略了源集合中的 count 个元素。

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)

从序列的开头返回指定数量的相邻元素。

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

从序列中返回指定范围的连续元素。

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

返回一个新的可枚举集合,它包含 count 中的最后 source 个元素。

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>(IEnumerable<TSource>, Func<TSource,TKey>)

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

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

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

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

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

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

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

ToHashSet<TSource>(IEnumerable<TSource>)

IEnumerable<T> 创建一个 HashSet<T>

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

使用 comparer 通过 IEnumerable<T> 创建 HashSet<T>,以用于比较键。

ToList<TSource>(IEnumerable<TSource>)

IEnumerable<T> 创建一个 List<T>

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

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

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

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

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

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

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

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

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

尝试在不强制枚举的情况下确定序列中的元素数。

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

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

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

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

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

根据指定的键选择器函数生成两个序列的集联合。

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

根据指定的键选择器函数生成两个序列的集联合。

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

基于谓词筛选值序列。

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

基于谓词筛选值序列。 将在谓词函数的逻辑中使用每个元素的索引。

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

使用两个指定序列中的元素生成元组序列。

Zip<TFirst,TSecond,TThird>(IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>)

使用三个指定序列中的元素生成元组序列。

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

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

AsParallel(IEnumerable)

启用查询的并行化。

AsParallel<TSource>(IEnumerable<TSource>)

启用查询的并行化。

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryable

AsQueryable<TElement>(IEnumerable<TElement>)

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

Ancestors<T>(IEnumerable<T>)

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

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

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

DescendantNodes<T>(IEnumerable<T>)

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

Descendants<T>(IEnumerable<T>)

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

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

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

Elements<T>(IEnumerable<T>)

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

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

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

InDocumentOrder<T>(IEnumerable<T>)

返回节点集合(其中包含源集合中的所有节点),并按文档顺序排列。

Nodes<T>(IEnumerable<T>)

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

Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。

适用于