So the method of scientific poking brought the result. It turned out that the sharpdevelop file anyname.settings is just a convenient interface for adding stored parameters (the same as in the properties window of the visual studio project), and there can be a lot of them (such files).
So, when creating the foo.settings and bar.settings in the testapp project and testapp bar and foo variables there, respectively, new branches appear in the app.config , which look like this:
<userSettings> <testapp.foo> <setting name="bar" serializeAs="String"> <value>barValue</value> </setting> </testapp.foo> <testapp.bar> <setting name="foo" serializeAs="String"> <value>fooValue</value> </setting> </testapp.bar> </userSettings>
And now in the code you can do this:
void MainFormLoad(object sender, EventArgs e) { //читаем значение string barVal = foo.Default.bar; // barValue //или так barVal = foo.Default.Properties["bar"].ToString(); // barValue //меняем значение foo.Default.bar = "New bar value"; //сохраняем параметры в реестр (будут доступны при следующих запусках приложения) foo.Default.Save(); //опять читаем barVal = foo.Default.bar; // New bar value //получаем значение по умолчанию barVal = foo.Default.Properties["bar"].DefaultValue.ToString(); // barValue }
All the same is true for the second branch:
string fooVal = bar.Default.foo; // fooValue
By the way, after compilation everything from the app.config project, including the default values of our parameters, goes into testapp.exe.config which should be in the same folder with the compiled testapp.exe .
I hope someone will be useful.