I'm working with a sealed Singleton Settings class, where I've found following definition of a property:
public Boolean aRandomProperty
{
get
{
return (Boolean)this["aRandomProperty"];
}
set
{
this["aRandomProperty"] = value;
}
}
While having a look at the source code, I've seen that this property is used as:
SomeOtherVariable = Settings.Instance.aRandomProperty;
Settings.Instance.aRandomProperty = true;
I believe that a simple definition of the property, like the following, would work too:
public Boolean aRandomProperty;
Can anybody explain me what more can be done with that difficult getter/setter definition (I also completely don't understand the this["aRandomProperty"] part)?
For your information: the Settings class is derived from System.Configuration.ApplicationSettingsBase.
Nowhere in the code, there is this[ (even not with a bunch of spaces), so I believe there's no indexer defined.