Beispiel #1
0
        /// <summary>
        /// ChangeRule: typeof(BarkerERDiagram)
        /// Disallows changing the name of the Barker ER Diagram
        /// Changes the name of the <see cref="BarkerERDiagram"/> to
        /// its default name if changed by a user.
        /// </summary>
        private static void NameChangedRule(ElementPropertyChangedEventArgs e)
        {
            Guid attributeId = e.DomainProperty.Id;

            if (attributeId == Diagram.NameDomainPropertyId)
            {
                BarkerERDiagram diagram = e.ModelElement as BarkerERDiagram;
                string          name    = ORMSolutions.ORMArchitect.Framework.Design.ResourceAccessor <BarkerERDiagram> .ResourceManager.GetString(NameResourceName);

                if (diagram != null && diagram.Name != name)
                {
                    diagram.Name = name;
                }
            }
        }
Beispiel #2
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);
     }
 }
Beispiel #3
0
 public override void ElementAdded(Microsoft.VisualStudio.Modeling.ElementAddedEventArgs e)
 {
     ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Views.BarkerERView.BarkerERDiagram.BinaryAssociationAddedRule");
     BarkerERDiagram.BinaryAssociationAddedRule(e);
     ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Views.BarkerERView.BarkerERDiagram.BinaryAssociationAddedRule");
 }
Beispiel #4
0
 public override void ElementPropertyChanged(Microsoft.VisualStudio.Modeling.ElementPropertyChangedEventArgs e)
 {
     ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Views.BarkerERView.BarkerERDiagram.DisplayEntityTypePropertyChangedRule");
     BarkerERDiagram.DisplayEntityTypePropertyChangedRule(e);
     ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Views.BarkerERView.BarkerERDiagram.DisplayEntityTypePropertyChangedRule");
 }
Beispiel #5
0
 public override void ElementDeleting(Microsoft.VisualStudio.Modeling.ElementDeletingEventArgs e)
 {
     ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Views.BarkerERView.BarkerERDiagram.ConceptTypeDetachingFromObjectTypeRule");
     BarkerERDiagram.ConceptTypeDetachingFromObjectTypeRule(e);
     ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Views.BarkerERView.BarkerERDiagram.ConceptTypeDetachingFromObjectTypeRule");
 }