Common
A library of common classes.
HashMap< TKey, TValue > Class Template Reference

A dictionary that is data contract serializable. More...

Inheritance diagram for HashMap< TKey, TValue >:
HashMapBase< TKey, TValue >

Public Member Functions

 HashMap ()
 Initializes a new empty dictionary. More...
 
 HashMap (HashMap< TKey, TValue > dict)
 Initializes a copy of the specified dictionary. More...
 
 HashMap (int capacity)
 Initializes a new dictionary with the specified capacity. More...
 
- Public Member Functions inherited from HashMapBase< TKey, TValue >
void Add (KeyValuePair< TKey, TValue > item)
 
void Add (TKey key, TValue value)
 
void Clear ()
 
bool Contains (KeyValuePair< TKey, TValue > item)
 
bool ContainsKey (TKey key)
 
void CopyTo (Array array, int index)
 
void CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex)
 
Dictionary< TKey, TValue >.Enumerator GetEnumerator ()
 
bool Remove (KeyValuePair< TKey, TValue > item)
 
bool Remove (TKey key)
 
bool TryGetValue (TKey key, out TValue value)
 

Static Public Member Functions

static implicit operator HashMap< TKey, TValue > (Dictionary< TKey, TValue > dict)
 Creates a new data contract dictionary instance with the specified dictionary assigned. More...
 

Properties

KeyValue< TKey, TValue >[] KeyValueArray [getset]
 An array of key value pairs. More...
 
- Properties inherited from HashMapBase< TKey, TValue >
int Count [get]
 
Dictionary< TKey, TValue > Dictionary = new Dictionary<TKey, TValue>() [getprotected set]
 The underlying dictionary. More...
 
bool IsReadOnly [get]
 
bool IsSynchronized [get]
 
Dictionary< TKey, TValue >.KeyCollection Keys [get]
 
ICollection< TKey > IDictionary< TKey, TValue >. Keys [get]
 
IEnumerable< TKey > IReadOnlyDictionary< TKey, TValue >. Keys [get]
 
object SyncRoot [get]
 
TValue this[TKey key] [getset]
 
Dictionary< TKey, TValue >.ValueCollection Values [get]
 
ICollection< TValue > IDictionary< TKey, TValue >. Values [get]
 
IEnumerable< TValue > IReadOnlyDictionary< TKey, TValue >. Values [get]
 

Private Member Functions

KeyValue< TKey, TValue >[] GetKeyValueArray ()
 Returns a new array of key value pairs for the dictionary. More...
 
void SetDictionary (KeyValue< TKey, TValue >[] array)
 Sets the dictionary from an array of key value pairs. More...
 

Detailed Description

A dictionary that is data contract serializable.

Definition at line 11 of file HashMap.cs.

Constructor & Destructor Documentation

◆ HashMap() [1/3]

HashMap ( )

Initializes a new empty dictionary.

Definition at line 22 of file HashMap.cs.

◆ HashMap() [2/3]

HashMap ( int  capacity)

Initializes a new dictionary with the specified capacity.

Parameters
capacityThe capacity.

Definition at line 31 of file HashMap.cs.

◆ HashMap() [3/3]

HashMap ( HashMap< TKey, TValue >  dict)

Initializes a copy of the specified dictionary.

Parameters
dictThe dictionary.

Definition at line 40 of file HashMap.cs.

Member Function Documentation

◆ GetKeyValueArray()

KeyValue< TKey, TValue >[] GetKeyValueArray ( )
private

Returns a new array of key value pairs for the dictionary.

Definition at line 57 of file HashMap.cs.

◆ operator HashMap< TKey, TValue >()

static implicit operator HashMap< TKey, TValue > ( Dictionary< TKey, TValue >  dict)
static

Creates a new data contract dictionary instance with the specified dictionary assigned.

Parameters
dictThe dictionary.

Definition at line 49 of file HashMap.cs.

◆ SetDictionary()

void SetDictionary ( KeyValue< TKey, TValue >[]  array)
private

Sets the dictionary from an array of key value pairs.

Parameters
arrayAn array of key value pairs.

Definition at line 77 of file HashMap.cs.

Property Documentation

◆ KeyValueArray

KeyValue<TKey, TValue> [] KeyValueArray
getset

An array of key value pairs.

Definition at line 17 of file HashMap.cs.


The documentation for this class was generated from the following file: