Click or drag to resize
DictionaryBaseTKey, TValue Class
DictionaryBase is a base class that can be used to more easily implement the generic IDictionary<T> and non-generic IDictionary interfaces.
Inheritance Hierarchy
SystemObject
  X3Platform.CollectionsCollectionBaseKeyValuePairTKey, TValue
    X3Platform.CollectionsDictionaryBaseTKey, TValue
      X3Platform.CollectionsOrderedDictionaryTKey, TValue
      X3Platform.CollectionsOrderedDictionaryTKey, TValueView

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
[SerializableAttribute]
public abstract class DictionaryBase<TKey, TValue> : CollectionBase<KeyValuePair<TKey, TValue>>, 
	IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, 
	IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, 
	IEnumerable

Type Parameters

TKey
The key type of the dictionary.
TValue
The value type of the dictionary.

The DictionaryBaseTKey, TValue type exposes the following members.

Constructors
  NameDescription
Protected methodDictionaryBaseTKey, TValue
Initializes a new instance of the DictionaryBaseTKey, TValue class
Top
Methods
  NameDescription
Public methodAdd(KeyValuePairTKey, TValue)
Adds a key-value pair to the collection. This implementation calls the Add method with the Key and Value from the item.
(Overrides CollectionBaseTAdd(T).)
Public methodAdd(TKey, TValue)
Adds a new key-value pair to the dictionary.
Public methodAsReadOnly
Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides a view of the dictionary that prevents modifications to the dictionary. Use the method to provide access to the dictionary without allowing changes. Since the returned object is just a view, changes to the dictionary will be reflected in the view.
Public methodClear
Clears the dictionary. This method must be overridden in the derived class.
(Overrides CollectionBaseTClear.)
Public methodContains
Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) the value.
(Overrides CollectionBaseTContains(T).)
Public methodContainsKey
Determines whether a given key is found in the dictionary.
Public methodConvertAllTOutput
Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration contains the result of applying converter to each item in this collection, in order.
(Inherited from CollectionBaseT.)
Public methodCopyTo
Copies all the items in the collection into an array. Implemented by using the enumerator returned from GetEnumerator to get all the items and copy them to the provided array.
(Inherited from CollectionBaseT.)
Public methodCountWhere
Counts the number of items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodEquals (Inherited from Object.)
Public methodExists
Determines if the collection contains any item that satisfies the condition defined by predicate.
(Inherited from CollectionBaseT.)
Protected methodFinalize (Inherited from Object.)
Public methodFindAll
Enumerates the items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodForEach
Performs the specified action on each item in this collection.
(Inherited from CollectionBaseT.)
Public methodGetEnumerator
Must be overridden to enumerate all the members of the collection.
(Inherited from CollectionBaseT.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove(KeyValuePairTKey, TValue)
Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) the value. If so, the key-value pair is removed.
(Overrides CollectionBaseTRemove(T).)
Public methodRemove(TKey)
Removes a key from the dictionary. This method must be overridden in the derived class.
Public methodRemoveAll
Removes all the items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodToArray
Creates an array of the correct size, and copies all the items in the collection into the array, by calling CopyTo.
(Inherited from CollectionBaseT.)
Public methodToString
Shows the string representation of the dictionary. The string representation contains a list of the mappings in the dictionary.
(Overrides CollectionBaseTToString.)
Public methodTrueForAll
Determines if all of the items in the collection satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodTryGetValue
Determines if this dictionary contains a key equal to key. If so, the value associated with that key is returned through the value parameter. This method must be overridden by the derived class.
Top
Properties
  NameDescription
Public propertyCount
Must be overridden to provide the number of items in the collection.
(Inherited from CollectionBaseT.)
Public propertyItem
The indexer of the dictionary. This is used to store keys and values and retrieve values from the dictionary. The setter accessor must be overridden in the derived class.
Public propertyKeys
Returns a collection of the keys in this dictionary.
Public propertyValues
Returns a collection of the values in this dictionary. The ordering of values in this collection is the same as that in the Keys collection.
Top
Remarks

To use DictionaryBase as a base class, the derived class must override Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor.

See Also