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)); }
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())); } }