public class MyTable:Hashtable
{
List<object> keyList;
Hashtable table;
public MyTable()
{
keyList = new List<object>();
table = new Hashtable();
}
public void Add(object key,object obj)
{
if (table.ContainsKey(key)) { }
else
{
keyList.Add(key);
table.Add(key, obj);
}
}
public object getValue(int index){
return table[keyList[index]];
}
public object getKey(int index)
{
return keyList[index];
}
public int getLength()
{
return keyList.Count();
}
public bool ContainsKey(object obj)
{
return table.ContainsKey(obj);
}
public void Remove(object obj)
{
table.Remove(obj);
keyList.Remove(obj);
}
}