Skip to content

Software Should Remember UserSettings – does yours?

September 6, 2006

I’m curious how most developers out there are currently saving user settings in WPF, WinForms, other?

For example: remembering the Window size and location, the zoom setting, recently viewed documents, etc…

My.Settings & Properties.Settings.Default

Are you using My.Settings (VB) and Properties.Settings.Default (C#)?

If so, what else do you want from it?
What could it do better?

Are you happy with the VS designer for it?
How could it be improved?

Other Techniques

What other techniques are you using?
Why?

Why do I ask?

I doing some thinking in this area…building a Sample that does some XAML integration with the Settings object.  I’d love to know what you think…

 

Related Resources

MSDN articles:

From → Software Should

4 Comments
  1. Unknown permalink

    My WPF XBAP application saves a lot of user data using Properties.Settings.Default (locations of things, things the user wants to have displayed in the application, certain UI behavior options, the general color theme of the application). It\’s an app that needs to run under MCE, and I\’m very worried about the fact that all these settings get scavenged along with the ClickOnce cache once the cache reaches its limit (or someone decides to clean it out "by hand"). This is something that I feel strongly about and think Microsoft should address.
     
    It would be ideal if the ApplicationSettingsBase class had an option for specifying at least part of the path to where the settings are to be stored so they could be safe from ClickOnce cache scavenging. Instead of defaulting to the ClickOnce cache (in the case of an XBAP for Media Center that\’s installed on the hard drive), the settings would be better off in the User\’s normal profile directory. The ApplicationSettingsBase could still decide on the precise mangled folder name to do all its magic, but being able to specify a parent folder for it in code would be a very welcome change!
     
    Also, I think the designer should be able to browse into user-defined classes and not just system classes. You can sort of force it to do that today by hand-editing the XML file for the settings, but that\’s a bit "rough" in my opinion.
     
    -Oluf

  2. Unknown permalink

    I\’d love to be able to give a category for each setting. This would allow organizing the settings into groups in the designer (and maybe even the settings class?) and help manage projects where you have lots of settings.
     
    Also, better safety & error management for corrupted / hacked settings files would be nice ("no user modifiable/hackable data is safe").
    //Tomi B.

  3. Rob permalink

    I don\’t own the Settings object, but I am meeting with the team who does next week.  I\’m going to share my ideas of things to improve…but I figured you folks would have better data than me.
     
    Oluf-
    Yes, once you have gone to the trouble to remember user settings, it hurts badly to have them scavenged.  Thanks.
    User defined classes.  Thanks.
     
    Tomi-
    Categories.  Thanks.
    Safety/Error Hanlding.  Thanks.
    Follow up question – what is the typical number of settings your apps keep track of this way?  what is the workflow?  do you do it after the app is built or as each form is being built?
     
    Thanks, Rob

  4. Unknown permalink

    I\’d really like to be able to specify namespaces for my settings, e.g. NameS1.NameS2.PropName would map to the following:-
    Properties.Settings.Default.NameS1.NameS2.PropName
     
    It would be nice if you could traverse the (tree of) settings, though to be honest I can\’t think of a compelling reason why at the moment. e.g. foreach (Setting s in Properties.Settings.Default.Traverse("NameS1.NameS2")) …
     
    Lastly I\’d like to see built in (easy) support for encrypted settings. Perhaps Properties.Settings.Encrypted.NameS1.NameS2.PropName.
     
    -Mark N

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: