Click or drag to resize

DictionaryWithDefaultTKey, TValue Class

A DictionaryTKey, TValue but with a default value for missing entries.
Inheritance Hierarchy
SystemObject
  System.Collections.GenericDictionaryTKey, TValue
    Archon.SwissArmyLib.CollectionsDictionaryWithDefaultTKey, TValue

Namespace:  Archon.SwissArmyLib.Collections
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class DictionaryWithDefault<TKey, TValue> : Dictionary<TKey, TValue>
Request Example View Source

Type Parameters

TKey
TValue

The DictionaryWithDefaultTKey, TValue type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyComparer
Gets the IEqualityComparerT that is used to determine equality of keys for the dictionary.
(Inherited from DictionaryTKey, TValue.)
Public propertyCount
Gets the number of key/value pairs contained in the DictionaryTKey, TValue.
(Inherited from DictionaryTKey, TValue.)
Public propertyDefaultValue
Default value for missing entries.
Public propertyItem
Gets or sets the value associated with the given key. If the key isn't in the dictionary, DefaultValue will be returned.
Public propertyKeys
Gets a collection containing the keys in the DictionaryTKey, TValue.
(Inherited from DictionaryTKey, TValue.)
Public propertyValues
Gets a collection containing the values in the DictionaryTKey, TValue.
(Inherited from DictionaryTKey, TValue.)
Top
Methods
  NameDescription
Public methodAdd
Adds the specified key and value to the dictionary.
(Inherited from DictionaryTKey, TValue.)
Public methodClear
Removes all keys and values from the DictionaryTKey, TValue.
(Inherited from DictionaryTKey, TValue.)
Public methodContainsKey
Determines whether the DictionaryTKey, TValue contains the specified key.
(Inherited from DictionaryTKey, TValue.)
Public methodContainsValue
Determines whether the DictionaryTKey, TValue contains a specific value.
(Inherited from DictionaryTKey, TValue.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through the DictionaryTKey, TValue.
(Inherited from DictionaryTKey, TValue.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetObjectData
Implements the ISerializable interface and returns the data needed to serialize the DictionaryTKey, TValue instance.
(Inherited from DictionaryTKey, TValue.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnDeserialization
Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
(Inherited from DictionaryTKey, TValue.)
Public methodRemove
Removes the value with the specified key from the DictionaryTKey, TValue.
(Inherited from DictionaryTKey, TValue.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTryGetValue
Gets the value associated with the specified key.
(Inherited from DictionaryTKey, TValue.)
Top
See Also