Event 是常常被來做callback使用
可以分成兩種狀態
使用上的注意事項如下
因為觀感不好???
System.EventHandler<T>
public class NotifyingContactCollection : Collection<Contact>{
public event EventHandler<ContactAddedEventArgs> ContactAdded;
}
public class AlarmRaisedEventArgs : EventArgs{
....
}
procted virtual void OnAlarmRaised(AlarmRaisedEventArgs e){
...
}
public delegate void ClickedEventHandler(object sender, ClickedEventArgs e);