Type t = dict.GetType();
bool isDict = t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Dictionary<,>);
You can then get the key and value types:
Type keyType = t.GetGenericArguments()[0];
Type valueType = t.GetGenericArguments()[1];
Type t = dict.GetType();
bool isDict = t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Dictionary<,>);
You can then get the key and value types:
Type keyType = t.GetGenericArguments()[0];
Type valueType = t.GetGenericArguments()[1];