I wrote several classes:
public class A { public A() { serviceAdapter.CompletedCallBackEvent += new EventHandler( foo ); . . . } void foo(object sender, EventArgs e) { serviceAdapter.CompletedCallBackEvent -= new EventHandler( foo ); } }
Now I want to change this callback listener with some anonymous - but I donโt know how to remove the callback listener in the anonymous method.
class A { public A() { serviceAdapter.CompletedCallBackEvent += delegate( object sender, EventArgs ee ) { ... need to remove the listener to the event. } } }
source share