Esempio n. 1
0
 void IModelingEventSubscriber.ManageModelingEventHandlers(ModelingEventManager eventManager, EventSubscriberReasons reasons, EventHandlerAction action)
 {
     if (action == EventHandlerAction.Add && 0 != (reasons & EventSubscriberReasons.DocumentLoading))
     {
         // Hack implementation to turn on the FixupDiagram rules before the model loads.
         // Normally this would be done with a coordinated fixup listener. However, we
         // have no control over the DSL-generated FixupDiagram rule without jumping through
         // a lot of hoops, so we do it here, which fires after the rules are created and
         // before the model loads.
         Store.RuleManager.EnableRule(typeof(FixUpDiagram));
     }
     if (0 != (reasons & EventSubscriberReasons.DocumentLoaded))
     {
         Store store = Store;
         BarkerEntityShape.ManageEventHandlers(store, eventManager, action);
         BarkerERDiagram.ManageEventHandlers(store, eventManager, action);
     }
 }