Nat*_*ate 2 c# class this instant
在下面的示例中,this []在类中用于从类instant的某处获取值.这个值存储在哪里?是否可能是[]运算符被重载或者这只是我不熟悉的c#语法?
public class MyUserSettings : ApplicationSettingsBase
{
[UserScopedSetting()]
[DefaultSettingValue("white")]
public Color BackgroundColor
{
get
{
return ((Color)this["BackgroundColor"]);
}
set
{
this["BackgroundColor"] = (Color)value;
}
}
}
Run Code Online (Sandbox Code Playgroud)