I want to use the OnCreateFeature-Event to combine it with other actions. So I use
Events.OnCreateFeature += delegate(IObject obj) { LoopTools_OnCreateFeature(obj); };
to listen to this event. That works very well.
But how can I stop listening? I tried
Events.OnCreateFeature -= delegate(IObject obj) { LoopTools_OnCreateFeature(obj); };
but this didn't release the event. So when I looped through some sweeps, it happened that I have wired the event two or more times and the corresponding actions are done to often. I also tried
Events.OnCreateFeature -= LoopTools_OnCreateFeature;
but that has the same effect. What am I doing wrong?
I'm thankful for any suggestions.