예제 #1
0
 public SoundCaller(SoundEffect eff)
 {
     this.publisher  = new SoundPublisher(eff);
     this.subscriber = new SoundSubscriber();
     this.subscriber.Subscribe(this.publisher);
     this.publisher.Execute();
 }
 public void Subscribe(SoundPublisher publisher)
 {
     publisher.Tick += new SoundPublisher.EventHandler(this.TakeAction);
 }
 private void TakeAction(SoundPublisher publisher, EventArgs e)
 {
     publisher.SoundEffect.Play();
 }