T_Cyjb_Collections_ObjectModel_DictionaryBase_2 - CYJB/Cyjb GitHub Wiki

DictionaryBase(TKey, TValue) 类

为泛型字典提供基类。

继承层次

System.Object
  Cyjb.Collections.ObjectModel.DictionaryBase(TKey, TValue)
Namespace: Cyjb.Collections.ObjectModel
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

[SerializableAttribute]
public abstract class DictionaryBase<TKey, TValue> : IDictionary<TKey, TValue>, 
	ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, 
	IEnumerable, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, 
	IDictionary, ICollection

类型参数

 

TKey
字典中的键的类型。
TValue
字典中的值的类型。
  The DictionaryBase(TKey, TValue) type exposes the following members.

构造函数

 

名称 说明
受保护的方法 DictionaryBase(TKey, TValue) 初始化 DictionaryBase(TKey, TValue) 类的新实例。
  Back to Top

属性

 

名称 说明
公共属性 Count 获取当前字典包含的元素数。
公共属性 Item 获取或设置具有指定键的元素。
公共属性 Keys 获取包含当前字典的键的 ICollection(T)
公共属性 Values 获取包含当前字典的值的 ICollection(T)
  Back to Top

方法

 

名称 说明
公共方法 Add 向当前字典添加一个带有所提供的键和值的元素。
受保护的方法 CheckIsReadOnly 检查当前字典是否是只读的。
公共方法 Clear 从当前字典中移除所有元素。
公共方法 ContainsKey 确定当前字典是否包含带有指定键的元素。
公共方法 Equals Determines whether the specified object is equal to the current object. (继承自 Object。)
受保护的方法 Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。)
公共方法 GetEnumerator 返回一个循环访问字典的枚举器。
公共方法 GetHashCode Serves as the default hash function. (继承自 Object。)
受保护的方法 GetSyncRoot 获取一个可用于同步对当前字典的访问的对象。
公共方法 GetType Gets the Type of the current instance. (继承自 Object。)
受保护的方法 MemberwiseClone Creates a shallow copy of the current Object. (继承自 Object。)
公共方法 Remove 从当字典中移除包含指定键的元素。
受保护的方法 SetCollectionReadOnly 将当前字典设置为只读的。
公共方法 ToString Returns a string that represents the current object. (继承自 Object。)
公共方法 TryGetValue 获取与指定键关联的值。
  Back to Top

扩展方法

 

名称 说明
公共扩展器方法 AddRange(KeyValuePair(TKey, TValue)) 将指定集合的元素添加到当前集合中。 (由 CollectionUtil 定义。)
公共扩展器方法 AsReadOnly(KeyValuePair(TKey, TValue)) 返回当前集合的只读包装。 (由 CollectionUtil 定义。)
公共扩展器方法 IsDistinct(KeyValuePair(TKey, TValue)) 判断序列中是否不包含重复元素。 (由 EnumerableUtil 定义。)
  Back to Top

参见

Reference

Cyjb.Collections.ObjectModel 命名空间

⚠️ **GitHub.com Fallback** ⚠️