コード例 #1
0
 public UniversalRemote(TV tv, SurroundSound ss, DVD dvd, Game gs)
 {
     m_tv  = tv;
     m_ss  = ss;
     m_dvd = dvd;
     m_gs  = gs;
 }
コード例 #2
0
 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();
 }