An NDoc Documented Class Library

Preferences Class

Provides a way to persist user preferences.

For a list of all members of this type, see Preferences Members.

System.Object
   Preferences

public abstract class Preferences : IDisposable

Remarks

By default, this class uses Isolated Storage to provide provide portable and safe persistance.
It is envisioned that in the future, alternate backing stores will be available (the registry would be an obvious one).

Example

Here's an example of how to persist the persist the personal details of a user (for registration purposes, perhaps).

            Preferences prefWriter = Preferences.GetUserNode("Personal Details");
            prefWriter.SetProperty("Name", "Joe Bloggs");
            prefWriter.SetProperty("Age", 56);
            prefWriter.Close();
            
And here's an example of how to read these properties back in.
            Preferences prefReader = Preferences.GetUserNode("Personal Details");
            string name = prefReader.GetString("Name", "Anonymous");
            int age = prefReader.GetInt32("Age", 0);
            prefReader.Close();
            

Requirements

Namespace: Genghis Namespace

Assembly: Genghis.dll

See Also

Preferences Members | Genghis Namespace