public UniversalRemote(TV tv, SurroundSound ss, DVD dvd, Game gs) { m_tv = tv; m_ss = ss; m_dvd = dvd; m_gs = gs; }
public Remote() { InitializeComponent(); tv = new TV(); ss = new SurroundSound(); dvd = new DVD(); gs = new Game(); concreteProduct = new ConcreteProduct(); factory = new ConcreteFactory(); tv.TVStateChanged += new TVStateChangedEventHandler(tv_TVStateChanged); ss.SurroundSoundStateChanged += new SurroundSoundStateChangedEventHandler(ss_SurroundSoundStateChanged); dvd.DVDStateChanged += new DVDStateChangedEventHandler(dvd_DVDStateChanged); gs.GameStateChanged += new GameStateChangedEventHandler(gs_GameStateChanged); UpdateControls(); }