public void Bar()
{
Foo foo = new Foo();
**foo.MyEvent += foo_MyEvent;**
foo.FireEvent();
}
void foo_MyEvent(object sender, EventArgs e)
{
((Foo)sender).MyEvent -= foo_MyEvent;
}
Hey I'm a bit unfamiliar with events, could someone tell me what the += operator does with events?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…