public virtual void BreakAllLinks() { for (int CurrentIndex = 0; CurrentIndex < LinkedEntities.Count; ++CurrentIndex) { EntityLink <EntityType> CurrentLink = LinkedEntities[CurrentIndex]; CurrentLink.BreakLink(this); } LinkedEntities.Clear(); }
public virtual void OnDisconnectedAnchors(Anchor <EntityType> LocalAnchor, Anchor <EntityType> RemoteAnchor) { EntityBox <EntityType> RemoteBox = RemoteAnchor.Owner; string LocalAnchorName = ""; string RemoteAnchorName = ""; if (Inputs.Contains(LocalAnchor)) { LocalAnchorName = "Input"; } else { LocalAnchorName = "Output"; } LocalAnchorName += LocalAnchor.GetLabelText(); if (RemoteBox.Inputs.Contains(RemoteAnchor)) { RemoteAnchorName = "Input"; } else { RemoteAnchorName = "Output"; } RemoteAnchorName += RemoteAnchor.GetLabelText(); EntityLink <EntityType> LocalLink = GetLinkByName(LocalAnchorName); EntityLink <EntityType> RemoteLink = RemoteBox.GetLinkByName(RemoteAnchorName); if (LocalLink != null && RemoteLink != null) { LocalLink.BreakLink(RemoteLink); } }