public bool RemoveLink(SOLink link) { bool bFound = Links.Remove(link); if (bFound) { if (link.Name != null && NamedLinks.ContainsKey(link.Name)) { NamedLinks.Remove(link.Name); } // We might be running this *in* a ChangeOp, in which case we // do not want to push another one. ugly problem =\ if (Scene.History.InPastState) { link.Unlink(); } else { IChangeOp change = link.GetRemoveChange(); if (change == null) { // we cannot undo this link removal link.Unlink(); } else { Scene.History.PushChange(change, false); } } } return(bFound); }
/// <summary> /// Remove link that has matching uuid /// </summary> public bool RemoveLinkByUUID(string uuid) { SOLink found = FindLinkByUUID(uuid); if (found == null) { return(false); } return(RemoveLink(found)); }
public void AddLink(SOLink link) { link.Manager = this; Links.Add(link); if (link.Name != null) { if (NamedLinks.ContainsKey(link.Name)) { throw new Exception("SOLinkManager.RegisterLink: named link already exists!"); } NamedLinks[link.Name] = link; } }
/// <summary> /// Remove link /// </summary> public bool RemoveLink(SOLink link) { bool bFound = Links.Remove(link); if (bFound) { if (link.Name != null && NamedLinks.ContainsKey(link.Name)) { NamedLinks.Remove(link.Name); } link.Unlink(); } return(bFound); }