public override void ElementAdded(ElementAddedEventArgs e)
        {
            base.ElementAdded(e);

            ModelDiagramData element = (ModelDiagramData)e.ModelElement;
            Store            store   = element.Store;
            Transaction      current = store.TransactionManager.CurrentTransaction;

            if (current.IsSerializing || ModelRoot.BatchUpdating)
            {
                return;
            }

            ModelDiagramData.OpenDiagram?.Invoke(element);
            element.SetDiagram(store.ElementDirectory.AllElements.OfType <EFModelDiagram>().FirstOrDefault(d => d.Name == element.Name));
        }
예제 #2
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            base.ElementAdded(e);

            ModelDiagramData element = (ModelDiagramData)e.ModelElement;
            Store            store   = element.Store;
            Transaction      current = store.TransactionManager.CurrentTransaction;

            if (current.IsSerializing || ModelRoot.BatchUpdating)
            {
                return;
            }

            ModelDiagramData.OpenDiagram?.Invoke(element);
            if (element.GetDiagram() == null)
            {
                element.SetDiagram(store.GetAll <EFModelDiagram>().FirstOrDefault(d => d.Name == store.ModelRoot().GetFileName()));
            }
        }