public ifoo GetThemedFoo(String theme) { if (_lastFoo != null) { _needsAnIfoo.SomethingIFooCanDealWith -= (sender, e) => _lastFoo.bar(); } ; ifoo newFoo = _themedFoos[theme]; _needsAnIfoo.SomethingIFooCanDealWith += (sender, e) => newFoo.bar(); _lastFoo = newFoo; return(newFoo); }
public void RegisterFoo(String themeName, ifoo foo) { _themedFoos.Add(themeName, foo); }