Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | Protected Member Functions | List of all members
Loyc.Collections.Impl.DictionaryBase< TKey, TValue > Class Template Referenceabstract

A base class for user-defined dictionaries that want to implement both IDictionary(K,V) and IReadOnlyDictionary(K, V). More...


Source file:
Inheritance diagram for Loyc.Collections.Impl.DictionaryBase< TKey, TValue >:
Loyc.Collections.IDictionaryAndReadOnly< TKey, TValue > Loyc.Collections.WeakKeyDictionary< TKey, TValue >

Remarks

A base class for user-defined dictionaries that want to implement both IDictionary(K,V) and IReadOnlyDictionary(K, V).

Modified version of source: datavault project. License: Apache License 2.0.

Properties

abstract int Count [get]
 
bool IsReadOnly [get]
 
ICollection< TKey > Keys [get]
 
ICollection< TValue > Values [get]
 
TValue this[TKey key] [get, set]
 

Public Member Functions

abstract void Clear ()
 
abstract void Add (TKey key, TValue value)
 
abstract bool ContainsKey (TKey key)
 
abstract bool Remove (TKey key)
 
abstract bool TryGetValue (TKey key, out TValue value)
 
abstract IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator ()
 
void Add (KeyValuePair< TKey, TValue > item)
 
bool Contains (KeyValuePair< TKey, TValue > item)
 
void CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex)
 
bool Remove (KeyValuePair< TKey, TValue > item)
 

Protected Member Functions

abstract void SetValue (TKey key, TValue value)
 Implementation of the setter for this[]. More...
 

Member Function Documentation

◆ SetValue()

abstract void Loyc.Collections.Impl.DictionaryBase< TKey, TValue >.SetValue ( TKey  key,
TValue  value 
)
protectedpure virtual

Implementation of the setter for this[].

The setter alone (without the getter) is not allowed to be virtual in C# so a separate method is required.

Implemented in Loyc.Collections.WeakKeyDictionary< TKey, TValue >.