Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Prevent OnChangeFeature event from firing within itself?

$
0
0
Hello,

I have an OnChangeFeature event wired to fire whenever a feature is changed (obviously). Within the event, I am updating a field value, which then fires the event again. Hence, infinite loop. How can I prevent this from happening?

I have tried to remove the event within itself by using:

Code:

editEvents.OnChangeFeature -= new IEditEvents_OnChangeFeatureEventHandler(OnChangeFeature);
...which works, but only if I don't add the event back (with a +=) afterward, which I need to do. If I add the event back, even after the field update, the event fires again.

Thanks,
Evan.

Viewing all articles
Browse latest Browse all 1374

Trending Articles