Book a Demo

Author Topic: EA_OnPreDelete events  (Read 2900 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
EA_OnPreDelete events
« on: September 13, 2011, 08:08:59 pm »
Hi All

I am writing an add-in which responds to the broadcast events

EA_OnPreDeleteElement
EA_OnPreDeleteDiagram
EA_OnPreDeletePackage

I have observed (by writing a very simple add-in) that if a CTRL+DEL is peformed on multiple elements, diagrams, or packages ... then this event is broadcast once for item in the selection. So far so good.

My intention (and indeed inferred by the User Guide) is that I can override this event and let the add-in decide whether or not each item in the selection is in fact to be deleted by returning true or false accordingly.

This works, BUT as soon as my Add-in returns false , the entire delete activity is abandoned and no further broadcasts are received.

Is this the behaviour intended by Sparx? Or is it a bug?

I would like to continue to receive a broadcast for all items in the selection, not abandon upon the first return of false.

Anyone else experienced this?

Cheers

Phil
Models are great!
Correct models are even greater!