diff options
Diffstat (limited to 'NW4RTools/Util')
-rw-r--r-- | NW4RTools/Util/IOrderedDictionary.cs | 3 | ||||
-rw-r--r-- | NW4RTools/Util/OrderedDictionary.cs | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/NW4RTools/Util/IOrderedDictionary.cs b/NW4RTools/Util/IOrderedDictionary.cs index a574c7c..6cf9b85 100644 --- a/NW4RTools/Util/IOrderedDictionary.cs +++ b/NW4RTools/Util/IOrderedDictionary.cs @@ -55,5 +55,8 @@ namespace NW4RTools.Util get;
set;
}
+
+
+ TKey GetKeyForIndex(int index);
}
}
diff --git a/NW4RTools/Util/OrderedDictionary.cs b/NW4RTools/Util/OrderedDictionary.cs index 3dd4fb4..98e523a 100644 --- a/NW4RTools/Util/OrderedDictionary.cs +++ b/NW4RTools/Util/OrderedDictionary.cs @@ -162,11 +162,15 @@ namespace NW4RTools.Util return List.GetEnumerator();
}
- IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey,TValue>>.GetEnumerator()
+ IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
{
return List.GetEnumerator();
}
+ public TKey GetKeyForIndex(int index) {
+ return List[index].Key;
+ }
+
/// <summary>
/// Inserts a new entry into the <see cref="OrderedDictionary{TKey,TValue}">OrderedDictionary<TKey,TValue></see> collection with the specified key and value at the specified index.
/// </summary>
|