ImmutableSortedDictionary<TKey,TValue>.Enumerator 结构

定义

枚举二进制树的内容。

NuGet package: System.Collections.Immutable关于不可变集合和安装方法

public: value class ImmutableSortedDictionary<TKey, TValue>::Enumerator : System::Collections::Generic::IEnumerator<System::Collections::Generic::KeyValuePair<TKey, TValue>>
public struct ImmutableSortedDictionary<TKey,TValue>.Enumerator : System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>>
type ImmutableSortedDictionary<'Key, 'Value>.Enumerator = struct
    interface IEnumerator<KeyValuePair<'Key, 'Value>>
    interface IEnumerator
    interface IDisposable
Public Structure ImmutableSortedDictionary(Of TKey, TValue).Enumerator
Implements IEnumerator(Of KeyValuePair(Of TKey, TValue))

类型参数

TKey
TValue
继承
ImmutableSortedDictionary<TKey,TValue>.Enumerator
实现

注解

此结构应与其他两个二进制树枚举器保持同步: System.Collections.Immutable.ImmutableList<T>.EnumeratorSystem.Collections.Immutable.ImmutableSortedSet<T>.Enumerator

注意

当此枚举器用作值类型 ((即未装箱) 时),请勿通过将它分配给第二个变量或通过将其传递给另一种方法来复制它。 释放此枚举器后,它会将可变引用类型堆栈返回到资源池,如果复制值类型枚举器 (在传递) 周围的值时,很容易意外地发生,则可能仍有一个堆栈已返回到资源池的风险仍可由其中一个枚举器副本使用, 导致数据损坏或异常。

属性

Current

获取枚举数当前位置的元素。

方法

Dispose()

释放 ImmutableSortedDictionary<TKey,TValue>.Enumerator 类的当前实例使用的资源。

MoveNext()

将枚举器推进到不可变排序字典的下一个元素。

Reset()

将枚举器设置到其初始位置,该位置位于不可变排序字典中的第一个元素之前。

显式接口实现

IEnumerator.Current

当前元素。

适用于

线程安全性

此类型是线程安全的。