← Back to team overview

do-plugins team mailing list archive

Re: Proposed merge of lp:~karol-bedkowski/do-plugins/systemservices into lp:do-plugins/community-future

 

Ok, I see why your blacklist is a string -- so you can store it in an IPreferences instance. Here's a nicer what to do that:


static IEnumerable<string> Blacklist {
  get { return prefs.Get ("blacklist", DefaultBlacklist).Split (); }
  set { prefs.Set ("blacklist", string.Join ("\n", value.ToArray ())); }
}

This way, this is the only piece of code that needs to know that "blacklist" is the preference key for your blacklist, and everywhere else you can do:

foreach (string service in Blacklist) {
  ...
}

Blacklist = any new array, list, whatever of strings.
-- 
https://code.edge.launchpad.net/~karol-bedkowski/do-plugins/systemservices/+merge/2317
You are subscribed to branch lp:do-plugins/community-future.



References