Hashtable with MultiDimensional Key in C#
Posted
by scottschulthess
on Stack Overflow
See other posts from Stack Overflow
or by scottschulthess
Published on 2009-03-27T14:18:43Z
Indexed on
2010/03/13
18:15 UTC
Read the original article
Hit count: 713
I'm basically looking for a way to access a hashtable value using a two-dimensional typed key in c#.
Eventually I would be able to do something like this
HashTable[1][false] = 5;
int a = HashTable[1][false];
//a = 5
This is what I've been trying...hasn't worked
Hashtable test = new Hashtable();
test.Add(new Dictionary<int, bool>() { { 1, true } }, 555);
Dictionary<int, bool> temp = new Dictionary<int, bool>() {{1, true}};
string testz = test[temp].ToString();
© Stack Overflow or respective owner