fbInstance.Invoke(1); 


?????????C#??????????????????????????????????????????????????????磺


fbInstance(1); 


???????????????????????

??????濴???????????????????????????????????????????з????????????????????????????Delegate???Combine??Remove??????


fbChain = (Feedback) Delegate.Combine(fbChain?? fb1);


??????????C#??????÷??????????????????+??+=??-??-=?????????????????????


fbChain += fb1; 


?????????????????

????C#???????????????????????????????ε????????????????????????????

????????????????????


public event EventHandler NewMail;


????C#??????????????????????μ????


// 1. A PRIVATE delegate field that is initialized to null
private EventHandler NewMail = null;
// 2. A PUBLIC add_Xxx method (where Xxx is the Event name)
// Allows methods to register interest in the event.
public void add_NewMail(EventHandler value) {
// The loop and the call to CompareExchange is all just a fancy way
// of adding a delegate to the event in a thread-safe way
EventHandlerprevHandler;
EventHandler newMail = this.NewMail;
do {
prevHandler = newMail;
EventHandlernewHandler =
(EventHandler) Delegate.Combine(prevHandler?? value);
newMail = Interlocked.CompareExchange>(
ref this.NewMail?? newHandler?? prevHandler);
} while (newMail != prevHandler);
}
// 3. A PUBLIC remove_Xxx method (where Xxx is the Event name)
// Allows methods to unregister interest in the event.
public void remove_NewMail(EventHandler value) {
// The loop and the call to CompareExchange is all just a fancy way
// of removing a delegate from the event in a thread-safe way
EventHandler prevHandler;
EventHandler newMail = this.NewMail;
do {
prevHandler = newMail;
EventHandler newHandler =
(EventHandler) Delegate.Remove(prevHandler?? value);
newMail = Interlocked.CompareExchange>(
ref this.NewMail?? newHandler?? prevHandler);
} while (newMail != prevHandler);
}

????????????????????????????????????????е?????????????????add_xxx??remove_xxx??????????????+=??-=??????????????????????????????????????????ж????????????????????????????????????????????????