Example #1
0
        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);
        }
Example #2
0
        /// <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));
        }
Example #3
0
 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;
     }
 }
Example #4
0
        /// <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);
        }