public override void ElementDeleting(ElementDeletingEventArgs e) { if (e.ModelElement.Store.InSerializationTransaction) { return; } if (e.ModelElement is MarriedToShape) { MarriedToShape shape = e.ModelElement as MarriedToShape; DiagramLayouter.Layout(shape.Diagram); } else { ParentOfShape shape = e.ModelElement as ParentOfShape; DiagramLayouter.Layout(shape.Diagram); } }
public override void ElementAdded(Microsoft.VisualStudio.Modeling.ElementAddedEventArgs e) { if (e.ModelElement.Store.InSerializationTransaction) { return; } if (e.ModelElement is MarriedToShape) { MarriedToShape shape = e.ModelElement as MarriedToShape; DiagramLayouter.Layout(shape.Diagram); } else { ParentOfShape shape = e.ModelElement as ParentOfShape; DiagramLayouter.Layout(shape.Diagram); } }