我有一个类 Locale,其中包含一个名为 Values 的公共字典。
我想要的是:
Locale l = new Locale(.....);
// execute stuff that loads the Values dictionary...
// currently to get the values in it I have to write :
string value = l.Values["TheKey"];
// What I want is to be able to get the same thing using :
string value = l["TheKey"];
当使用方括号和自定义类时,我基本上想更改返回值。