Possible Duplicate:
C# Adding and Removing Anonymous Event Handler
suppose I have an Action delegate declared this way:
public event Action<MenuTraverser.Actions> menuAction;
I am associating a method to it this way:
menuInputController.menuAction += (MenuTraverser.Actions action) => this.traverser.OnMenuAction(action);
Now, all works fine, but in certain situation I need to remove the delegated method and I don't know how. I tried this way but doesn't work:
menuInputController.menuAction -= (MenuTraverser.Actions action) => this.traverser.OnMenuAction(action);
How can I do such a thing? I need that my method OnMenuAction will be no longer called.