Rebornbuddy
|
LocalizedDictionary provides a dictionary that provides 3 different keys, a user-supplied type(often an int), and two strings. More...
Public Member Functions | |
bool | TryGetValue (K primaryKey, out V val) |
Gets the value associated with the specified key. | |
bool | ContainsKey (K primaryKey) |
Determines whether the T:System.Collections.Generic.Dictionary`2 contains the specified key. | |
void | Add (K primaryKey, string englishKey, string localizedKey, V val) |
Adds the item to the dictionaries. If englishkey or Localizedkey are null or empty then the item is only the primarykey will be used. | |
V[] | CloneValues () |
IEnumerator< KeyValuePair< K, V > > | GetEnumerator () |
Gets a collection containing the values in the T:System.Collections.Generic.Dictionary`2. |
Properties | |
V | this[string subKey] [get] |
Gets or sets the value associated with the specified key. | |
V | this[K primaryKey] [get] |
Gets or sets the value associated with the specified key. |
LocalizedDictionary provides a dictionary that provides 3 different keys, a user-supplied type(often an int), and two strings.
K | Primary Key Type |
V | Value Type |
void ff14bot.Helpers.LocalizedDictionary< K, V >.Add | ( | K | primaryKey, |
string | englishKey, | ||
string | localizedKey, | ||
V | val ) |
Adds the item to the dictionaries. If englishkey or Localizedkey are null or empty then the item is only the primarykey will be used.
primaryKey | |
englishKey | |
localizedKey | |
val |
V[] ff14bot.Helpers.LocalizedDictionary< K, V >.CloneValues | ( | ) |
bool ff14bot.Helpers.LocalizedDictionary< K, V >.ContainsKey | ( | K | primaryKey | ) |
Determines whether the T:System.Collections.Generic.Dictionary`2 contains the specified key.
/
subKey | The key to locate in the T:System.Collections.Generic.Dictionary`2. |
true
if the T:System.Collections.Generic.Dictionary`2 contains an element with the specified key; otherwise, false
./
T:System.ArgumentNullException | / subKey is null . |
public bool ContainsKey(string subKey) { return TryGetValue(subKey, out var val); }
/ Determines whether the T:System.Collections.Generic.Dictionary`2 contains the specified key.
primaryKey | The key to locate in the T:System.Collections.Generic.Dictionary`2. |
/
true
if the T:System.Collections.Generic.Dictionary`2 contains an element with the specified key; otherwise, false
.T:System.ArgumentNullException | primaryKey is null . |
IEnumerator< KeyValuePair< K, V > > ff14bot.Helpers.LocalizedDictionary< K, V >.GetEnumerator | ( | ) |
Gets a collection containing the values in the T:System.Collections.Generic.Dictionary`2.
/
public List<V> Values { get { _readerWriterLock.EnterReadLock();
try { return BaseDictionary.Values.ToList(); } finally { _readerWriterLock.ExitReadLock(); } } } /
/ / /
public K[] ClonePrimaryKeys() { _readerWriterLock.EnterReadLock();
try { K[] values = new K[BaseDictionary.Keys.Count];
BaseDictionary.Keys.CopyTo(values, 0);
return values; } finally { _readerWriterLock.ExitReadLock(); } }
/
/ Clear the dictionaries / public void Clear() { _readerWriterLock.EnterWriteLock();
try { BaseDictionary.Clear(); SubEnglishDictionary.Clear(); SubLocalizedDictionary.Clear(); } finally { _readerWriterLock.ExitWriteLock(); } }
/
/ Number of entries in the primary dictionary / public int Count { get { _readerWriterLock.EnterReadLock();
try { return BaseDictionary.Count; } finally { _readerWriterLock.ExitReadLock(); } } }
/ Returns an enumerator that iterates through the T:System.Collections.Generic.Dictionary`2.
bool ff14bot.Helpers.LocalizedDictionary< K, V >.TryGetValue | ( | K | primaryKey, |
out V | val ) |
Gets the value associated with the specified key.
subKey | The key of the value to get. |
val | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
true
if the T:System.Collections.Generic.Dictionary`2 contains an element with the specified key; otherwise, false
./
T:System.ArgumentNullException | / subKey is null . |
public bool TryGetValue(string subKey, out V val) { val = default(V);
_readerWriterLock.EnterReadLock();
try { K primaryKey; if (SubEnglishDictionary.TryGetValue(subKey, out val)) { return true; } if (DataManager.CurrentLanguage != Language.Eng) { if (SubLocalizedDictionary.TryGetValue(subKey, out val)) { return true; } }
} finally { _readerWriterLock.ExitReadLock(); } return false; }
/ Gets the value associated with the specified key. /
primaryKey | The key of the value to get. |
/
val | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
/
true
if the T:System.Collections.Generic.Dictionary`2 contains an element with the specified key; otherwise, false
.T:System.ArgumentNullException | primaryKey is null . |
|
get |
Gets or sets the value associated with the specified key.
primaryKey | The key of the value to get or set. |
T:System.ArgumentNullException | primaryKey is null . |
T:System.Collections.Generic.KeyNotFoundException | The property is retrieved and primaryKey does not exist in the collection. |
|
get |
Gets or sets the value associated with the specified key.
subKey | The key of the value to get or set. |
T:System.ArgumentNullException | subKey is null . |
T:System.Collections.Generic.KeyNotFoundException | The property is retrieved and subKey does not exist in the collection. |