Getting to the ApplicationSettingsBase Class

  • Thread starter Thread starter Doug Handler
  • Start date Start date
D

Doug Handler

Does anyone know how to access the Settings property information? VS2k5
created this, all documentation basically only points to VB.NET. When you
try it in C#, nothing is accessible. Any thoughts - has anyone been
successful in accessing this information via code? If so, can you show me
an example?

dh
 
Doug Handler said:
Does anyone know how to access the Settings property information? VS2k5
created this, all documentation basically only points to VB.NET. When you
try it in C#, nothing is accessible. Any thoughts - has anyone been
successful in accessing this information via code? If so, can you show me
an example?

Are you refering to the class VS generates when you add Settings in the
project properties?

If so, the Settings class it generates is in a Properties namespace. eg, if
I create a setting called "TestBool" of type bool, I get intelliense in my
forms to type:

Properties.Settings.Default.TestBool = true;
Properties.Settings.Default.Save();

Does that help?
 
Additionaly, if the settings are shared across multiple prj, simply LINK the
Settings.Designer.cs of the hosting settings to the client will do.

regards
 
I was wondering the same thing! After specifiying a setting in the Project
Designer, Settings Tab, how do you access that setting using C# code?

Dennis
 
Well, I don't know why MS didn't include documentation for this where
Project Designer, Settings are described, but you can access your project's
settigns with the Settings class. You can also work with settings events by
clicking the View Code button at the top of the Settings page.

Dennis
 
This is still not helpful. The only information I found in the documentation
is about creating a wrapper class the the AppSettingsBase class, which seems
like overkill if all you want to do is retrieve the settings in the user
scope. It does seem that the VB.NET documentation covers this functionality
when explaining the My.Settings class; just can't seems to find the
equivalent in the c# documentation. grrr.
 
Back
Top