I've got an object which is a Dictionary of an unknown type (ie I don't know the type for the key and the value)
I want to retrieve all of its values so I can access those by index.
So what I want to do is something like that :
Dictionary<object, object> d = (Dictionary<object, object>)obj; // cast error
l = new List<KeyValuePair<object,object>>();
foreach (KeyValuePair<object, object> k in d)
l.Add(new KeyValuePair<object,object>(k.Key, k.Value));
However, as expected, the runtime won't let me cast to a Dictionary< object, object>.
Is there a way to do this in .net 3.0 ? (for example using reflection?)