Cancelable BeforeRemove event for EntityCollectionBase2

Posts   
 
    
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 14-Jan-2006 05:46:26   

Greetings Frans,

I was wondering, why you doesn't the BeforeRemove event of the the EntityCollectionBase2 take a (CancelEventArgs) parameter instead of (EventArgs) specially that this is as per the Ms-Guidelines for Framework design??

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 14-Jan-2006 12:19:27   

I never considered it. But in v2 a lot of these events will be redesigned and a lot of them will be added, including cancel options.

Though I have to say: what should happen when the cancel is set: an exception or should the remove just be a no-op ?

Frans Bouma | Lead developer LLBLGen Pro
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 16-Jan-2006 06:22:08   

Reading through the (Framework Design Guidelines) book, they recommend that in such a case its just a no-op and that the AfterEvent should NOT fire also (so if we cancel the BeforeRemove the item is NOT removed from the list and hence the listChanged event would NOT fire..)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 16-Jan-2006 09:57:58   

Ok thanks simple_smile

Frans Bouma | Lead developer LLBLGen Pro