← Back to team overview

do-plugins team mailing list archive

New feature -- plugin preferences

 

I've added an IPreferences interface to Do.Addins. Plugins can get their own
managed preferences object using GetPreferences (string unique_name):

IPreferences prefs = Do.Addins.Util.GetPreferences ("my-plugin-name");
prefs ["folder"] = "~/Desktop";
string saved_something = prefs ["something"];

// also supports bools, ints, maybe more:

bool advanced_mode = prefs.Get<bool> ("advanced_mode", false);

// Wrap prefences Get/Set with properties:
int RefreshRate {
  get { return prefs.Get<int> ("RefreshRate", 10); }
  set {  prefs.Set<int> ("RefreshRate", value); }
}

Do handles the rest.

David