我需要创建一个公开IDictionary K,V的对象.接口,但我不想填写整个接口的实现. 拥有相当于Java的AbstractDictionary会很不错,这使得你很少能够推动完整的字典(HashMap,在Java中): 如果您不需要迭
拥有相当于Java的AbstractDictionary会很不错,这使得你很少能够推动完整的字典(HashMap,在Java中):
>如果您不需要迭代集合,那么您只需要一个方法来实现(TryGetValue)
>如果您希望它可写,则实现另一个条目(添加).
DictionaryBase is a base class that
can be used to more easily implement
the generic IDictionary<T> and
non-generic IDictionary interfaces.To use DictionaryBase as a base class, the derived class must override Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor.