Exemplo n.º 1
0
 public void OnFinishEdit(UInt32 actionBranchId, ILimnorDesignerLoader loader)
 {
     try
     {
         ILimnorDesignPane dp = loader.DesignPane;
         if (dp == null)
         {
             throw new DesignerException("ILimnorDesignPane not found for class {0}", loader.GetRootId());
         }
         IEvent       ep = _event;
         EventAction  ea = null;                //event-actions mapping
         ClassPointer a  = loader.GetRootId();
         if (a != null)
         {
             List <EventAction> lst = a.EventHandlers;
             if (lst != null)
             {
                 foreach (EventAction e in lst)
                 {
                     if (e.GetAssignActionId() == actionBranchId && e.Event.IsSameObjectRef(ep))
                     {
                         ea = e;
                         break;
                     }
                 }
             }
         }
         if (ea == null)
         {
             ea       = new EventAction();
             ea.Event = ep;
             if (actionBranchId != 0)
             {
                 ea.SetAssignActionId(actionBranchId);
             }
         }
         _handlerOwner = ea;
         ea.AddAction(this);
         a.SaveEventHandler(ea);
         dp.OnNotifyChanges();
         dp.OnAssignAction(ea);
     }
     catch (Exception err)
     {
         MathNode.Log(TraceLogClass.MainForm, err);
     }
     finally
     {
         this.ExitEditor();
     }
 }