语言

OptionalList<T> 类

定义

generic <typename T>
public ref class OptionalList : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IList<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::Generic::IReadOnlyList<T>
public class OptionalList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>
type OptionalList<'T> = class
    interface IList<'T>
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyList<'T>
    interface IReadOnlyCollection<'T>
Public Class OptionalList(Of T)
Implements ICollection(Of T), IEnumerable(Of T), IList(Of T), IReadOnlyCollection(Of T), IReadOnlyList(Of T)

类型参数

T
继承
OptionalList<T>
实现

构造函数

名称 说明
OptionalList<T>()
OptionalList<T>(OptionalProperty<IList<T>>)
OptionalList<T>(OptionalProperty<IReadOnlyList<T>>)

属性

名称 说明
Count
IsReadOnly
IsUndefined
Item[Int32]

方法

名称 说明
Add(T)
Clear()
Contains(T)
CopyTo(T[], Int32)
GetEnumerator()
IndexOf(T)
Insert(Int32, T)
Remove(T)
RemoveAt(Int32)
Reset()

显式接口实现

名称 说明
IEnumerable.GetEnumerator()

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

扩展方法

名称 说明
ToAsyncEnumerable<TSource>(IEnumerable<TSource>)

将 IEnumerable<T> 转换为 IAsyncEnumerable<T>。

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

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

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

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

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

使用指定的值创建一个 FrozenSet<T> 。

ToImmutableArray<TSource>(IEnumerable<TSource>)

从指定的集合创建不可变数组。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

枚举和转换序列,并使用指定的键和值比较器生成其内容的不可变字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

枚举和转换序列,并使用指定的键比较器生成其内容的不可变字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

枚举和转换序列,并生成其内容的不可变字典。

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

基于序列的某些转换构造不可变字典。

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

从现有元素集合构造不可变字典,将转换函数应用于源键。

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

枚举序列,生成其内容的不可变哈希集,并为集类型使用指定的相等比较器。

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

枚举序列并生成其内容的不可变哈希集。

ToImmutableList<TSource>(IEnumerable<TSource>)

枚举序列并生成其内容的不可变列表。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

枚举和转换序列,并使用指定的键和值比较器生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

枚举和转换序列,并使用指定的键比较器生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

枚举和转换序列,并生成其内容的不可变排序字典。

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

枚举序列,生成其内容的不可变排序集,并使用指定的比较器。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

枚举序列并生成其内容的不可变排序集。

适用于