This'll do I think.
public class IntDict<T> : IDictionary<int, T>
{
private Dictionary<int,T> internalDict = new Dictionary<int,T>();
//Sorry forgot this :P
public String Name { get; set; }
public void Add(int key, T value)
{
internalDict.Add(key,value);
}
public bool ContainsKey(int key)
{
return internalDict.ContainsKey(key);
}
public ICollection<int> Keys
{
get { return internalDict.Keys; }
}
public bool Remove(int key)
{
return internalDict.Remove(key);
}
public bool TryGetValue(int key, out T value)
{
return internalDict.TryGetValue(key, out value);
}
public ICollection<T> Values
{
get { return internalDict.Values; }
}
public T this[int key]
{
get
{
return internalDict[key];
}
set
{
internalDict[key] = value;
}
}
#region ICollection<KeyValuePair<int,T>> Members
public void Add(KeyValuePair<int, T> item)
{
internalDict.Add(item.Key, item.Value);
}
public void Clear()
{
internalDict.Clear();
}
public bool Contains(KeyValuePair<int, T> item)
{
return (internalDict.ContainsKey(item.Key) && internalDict.ContainsValue(item.Value));
}
private void CopyTo(KeyValuePair<int, T>[] array, int arrayIndex)
{
//Could be done but you prolly could figure this out yourself;
throw new Exception("do not use");
}
public int Count
{
get { return internalDict.Count; }
}
private bool IsReadOnly
{
get { return false; }
}
public bool Remove(KeyValuePair<int, T> item)
{
throw new NotImplementedException();
}
#endregion
#region IEnumerable<KeyValuePair<int,T>> Members
public IEnumerator<KeyValuePair<int, T>> GetEnumerator()
{
return internalDict.GetEnumerator();
}
#endregion
#region IEnumerable Members
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return internalDict.GetEnumerator();
}
#endregion
}