Reacting to entity modified event, weird behavior while debugging

Reacting to entity modified event, weird behavior while debugging

nshupeFMPE3
Advocate Advocate
270 Views
0 Replies
Message 1 of 1

Reacting to entity modified event, weird behavior while debugging

nshupeFMPE3
Advocate
Advocate

I've added an event handler to an Entities Modified event, and I have set breakpoints to the beginning of my event handler method. As I'm debugging, when I select the entity and use the color changer in the ribbon, the event seems to trigger before a selection has even been made. And then I'm unable to actually make the selection because then I'm in the debugger in Visual Studio, though the color dropdown is still drawn over visual studio. 

Is there some way I should be handling this event differently? 

 

using(Transaction tr = Active.Database.TransactionManager.StartTransaction())
            {
                Entity ent = id.GetObject(OpenMode.ForWrite, false) as Entity;

                ent.Modified += ZoneModifiedEvent.ZoneModified;

                tr.Commit();
            }

 

 

0 Likes
271 Views
0 Replies
Replies (0)