事件 委託 實現

事件 委託 實現

事件 委託 實現

事件 委託 實現

delegate void EventHandler();

class Boss : Subject
{
public event EventHandler Update;

public void Notify()
{
Update();
}

}

Boss b1 = new Boss();

b1.Update += new EventHandler(tongshi1.CloseA);
b1.Update += new EventHandler(tongshi2.CloseB);