請問為什下面的code要用event宣告SecondChange?
我把event拿掉改成 public event SecChgeHandler SecondChange;
這樣好像跑起來也沒問題.
感覺宣告有加event跟沒加event根本沒影響啊,那這樣宣告成event有甚麼必要性呢?
public delegate void SecChgHandler(obj clk,TEventArgs timeInfo);
public event SecChgeHandler SecondChange;
protected void OnSecondChange(obj clk,TEventArgs timeInfo)
{
if (SecondChange != null)
{
SecondChange.Invoke(clk, timeInfo);
}
}