public static TKey DictionaryKeyByIndex<TKey, TValue>(Dictionary<TKey, TValue> dic, int index)
{
var res = default(TKey);
try
{
res = dic.Keys.ToArray()[index];
}
catch
{
// ignored
}
return res;
}
public static TValue DictionaryValueByIndex<TKey, TValue>(Dictionary<TKey, TValue> dic, int index)
{
var res = default(TValue);
try
{
res = dic.Values.ToArray()[index];
}
catch
{
// ignored
}
return res;
}