ReadOnlyDictionary<TKey, TValue> 类
IDictionary<TKey, TValue>的只读版本。
继承层次结构
System.Object
Microsoft.TeamFoundation.Client.ReadOnlyDictionary<TKey, TValue>
命名空间: Microsoft.TeamFoundation.Client
程序集: Microsoft.TeamFoundation.Client(在 Microsoft.TeamFoundation.Client.dll 中)
语法
声明
Public Class ReadOnlyDictionary(Of TKey, TValue) _
Implements IDictionary(Of TKey, TValue), ICollection(Of KeyValuePair(Of TKey, TValue)), _
IEnumerable(Of KeyValuePair(Of TKey, TValue)), IDictionary, _
ICollection, IEnumerable
public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>,
ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>,
IDictionary, ICollection, IEnumerable
类型参数
- TKey
键的类型。
- TValue
值的类型。
ReadOnlyDictionary<TKey, TValue> 类型公开以下成员。
构造函数
名称 | 说明 | |
---|---|---|
![]() |
ReadOnlyDictionary<TKey, TValue> | 初始化 ReadOnlyDictionary 的新实例。 |
页首
属性
名称 | 说明 | |
---|---|---|
![]() |
Count | 获取字典中项的数目。 |
![]() |
Item | 获取匹配来指定键的值。 |
![]() |
Keys | 获取键的集合在字典中。 |
![]() |
Values | 获取值的集合在字典中。 |
页首
方法
名称 | 说明 | |
---|---|---|
![]() |
ContainsKey | 获取指示的标志指定的键字段包含在字典发生。 |
![]() |
Equals | 确定指定的对象是否等于当前对象。 (继承自 Object。) |
![]() |
Finalize | 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。) |
![]() |
GetEnumerator | 获取项目的 IEnumerator 在字典中。 |
![]() |
GetHashCode | 用作特定类型的哈希函数。 (继承自 Object。) |
![]() |
GetType | 获取当前实例的 Type。 (继承自 Object。) |
![]() |
MemberwiseClone | 创建当前 Object 的浅表副本。 (继承自 Object。) |
![]() |
ToString | 返回表示当前对象的字符串。 (继承自 Object。) |
![]() |
TryGetValue | 在 value获取对使用指定的 key 的值并将其存储。 |
页首
显式接口实现
页首
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。