Anonymous event handlers and disposing
问题 I have a rather short question about anonymous event handlers: This is the code that I have : public void AddTestControl(Control ctrl) { ctrl.Disposed += (o, e) => { RemoveTestControl(ctrl); }; ctrl.SomeEvent += _Control_SomeEvent; } public void RemoveTestControl(Control ctrl) { ctrl.SomeEvent -= _Control_SomeEvent; } Is this code above fine, or should the code be rewritten in order to remove the Disposed Event Handler? Something like this: public void AddTestControl(Control ctrl) { ctrl