public override void ElementDeleting(ElementDeletingEventArgs e) { if (e.ModelElement != null) { if (e.ModelElement.Store.TransactionManager.CurrentTransaction != null) { if (e.ModelElement.Store.TransactionManager.CurrentTransaction.IsSerializing) { return; } } } if (e.ModelElement == null) { return; } if (ImmutabilityExtensionMethods.GetLocks(e.ModelElement) != Locks.None) { return; } ReferenceRSNodeReferencesShapeRelationshipNodes con = e.ModelElement as ReferenceRSNodeReferencesShapeRelationshipNodes; if (con != null) { if (con.ShapeRelationshipNode != null) { con.ShapeRelationshipNode.Delete(); } } }
/// <summary> /// Called whenever a relationship of type ReferenceRSNodeReferencesShapeRelationshipNodes is deleted and /// the element hosted by this model is the source. /// </summary> /// <param name="args"></param> private void OnShapeNodeRemoved(ElementDeletedEventArgs args) { ReferenceRSNodeReferencesShapeRelationshipNodes con = args.ModelElement as ReferenceRSNodeReferencesShapeRelationshipNodes; if (con != null) { DeleteShapeNode(con.ShapeRelationshipNode); } }