public sealed class CustomDictionary<tkey,TValue> : KeyedCollection<tkey,TValue>>
{
protected override TKey GetKeyForItem(KeyValuePair<tkey,TValue> item)
{
return item.Key;
}
}
CustomDictionary<string,int> custDict = new CustomDictionary<string,int>();
CustDict.Add(new KeyValuePair<string,>("key", 7));
CustDict.Add(new KeyValuePair<string,>("key1", 8));
KeyValuePair<string,> i = CustDict[1];
int valueByIndex = CustDict[1].Value;
int valueByKey = CustDict["key"].Value;
string keyByIndex = CustDict[0].Key;
string skeyByIndex = CustDict[0].Key+","+CustDict[0].Value;