public void RemoveRelationship(Relationship relationship) { if (relationships.Contains(relationship)) { relationship.Detach(); relationship.Modified -= ElementChanged; relationships.Remove(relationship); OnRelationRemoved(new RelationshipEventArgs(relationship)); } }
public void RemoveRelationship(Relationship relationship) { if (_relationships.Contains(relationship)) { OnBeginUndoableOperation(this, EventArgs.Empty); relationship.Detach(); relationship.BeginUndoableOperation -= new EventHandler(OnBeginUndoableOperation); relationship.Modified -= new EventHandler(ElementChanged); _relationships.Remove(relationship); OnRelationRemoved(new RelationshipEventArgs(relationship)); } }
private void RemoveRelationships(IEntity entity) { for (int i = 0; i < relationships.Count; i++) { Relationship relationship = relationships[i]; if (relationship.First == entity || relationship.Second == entity) { relationship.Detach(); relationship.Modified -= ElementChanged; relationships.RemoveAt(i--); OnRelationRemoved(new RelationshipEventArgs(relationship)); } } }
private void RemoveRelationships(IEntity entity) { for (int i = 0; i < _relationships.Count; i++) { Relationship relationship = _relationships[i]; if (relationship.First == entity || relationship.Second == entity) { OnBeginUndoableOperation(this, EventArgs.Empty); relationship.Detach(); relationship.BeginUndoableOperation -= new EventHandler(OnBeginUndoableOperation); relationship.Modified -= new EventHandler(ElementChanged); _relationships.RemoveAt(i--); OnRelationRemoved(new RelationshipEventArgs(relationship)); } } }
public void RemoveRelationship(Relationship relationship) { if (relationships.Contains(relationship)) { relationship.Detach(); relationship.Modified -= ElementChanged; relationships.Remove(relationship); OnRelationRemoved(new RelationshipEventArgs(relationship)); } }