public virtual void ActivateObjects()
        {
            List <T> toBeRemoved = new List <T>();

            //TODO: Trace usage paths to confirm transaction is needed
            using (Transaction acTrans = HostDocument.Database.TransactionManager.StartTransaction())
            {
                foreach (T managedObject in ManagedObjects)
                {
                    if (!managedObject.CreateActiveObject())
                    {
                        toBeRemoved.Add(managedObject);
                    }
                }

                acTrans.Commit();
            }

            foreach (T removeObj in toBeRemoved)
            {
                ManagedObjects.Remove(removeObj);
            }

            SetActiveObjects();
        }
Example #2
0
        internal void UnregisterObject(Object obj)
        {
            lock (ManagedObjects)
            {
                if (!ManagedObjects.Contains(obj))
                {
                    return;
                }

                ManagedObjects.Remove(obj);

                if (obj is GameObject gameObject)
                {
                    if ((gameObject.Id.Flags & ObjectIdFlags.Spawned) != 0)
                    {
                        SpawnedObjects.Remove(gameObject);
                    }
                }

                var updated = UpdatedObjects.FirstOrDefault(u => u.Associate == obj);

                if (updated == default)
                {
                    return;
                }

                UpdatedObjects.Remove(updated);
            }
        }
Example #3
0
 /// <summary>
 /// Clears the <see cref="ExternalFileDataDataManager"/> disassociating any linked <see cref="ExternalFileData"/>
 /// </summary>
 protected override void Clear()
 {
     foreach (ExternalFileData EFd in ManagedObjects.ContentsAs_ListCopy)
     {
         ManagedObjects.Remove(EFd);
     }
     base.Clear();
 }
Example #4
0
 /// <summary>
 /// Clears the <see cref="MediaDataManager"/> disassociating any linked <see cref="MediaData"/>
 /// </summary>
 protected override void Clear()
 {
     foreach (MediaData md in ManagedObjects.ContentsAs_ListCopy)
     {
         ManagedObjects.Remove(md);
     }
     base.Clear();
 }
Example #5
0
 /// <summary>
 /// Clears the <see cref="ChannelsManager"/>, disassociating any <see cref="Channel"/>s
 /// </summary>
 protected override void Clear()
 {
     foreach (Channel ch in ManagedObjects.ContentsAs_ListCopy)
     {
         ManagedObjects.Remove(ch);
     }
     base.Clear();
 }
        ///// <summary>
        ///// Remove all <see cref="DataProvider"/> that are managed by the manager
        ///// </summary>
        ///// <param name="delete">A <see cref="bool"/> indicating if the removed data providers should be deleted</param>
        //public void RemoveUnusedDataProviders(List<DataProvider> usedDataProviders, bool delete)
        //{
        //    foreach (DataProvider prov in ManagedObjects.ContentsAs_YieldEnumerable)
        //    {
        //        if (!usedDataProviders.Contains(prov))
        //        {
        //            RemoveDataProvider(prov, delete);
        //        }
        //    }
        //}

        #endregion

        #region IXukAble Members

        /// <summary>
        /// Clears the <see cref="DataProviderManager"/>, clearing any links to <see cref="DataProvider"/>s
        /// </summary>
        protected override void Clear()
        {
            foreach (DataProvider dp in ManagedObjects.ContentsAs_ListCopy)
            {
                ManagedObjects.Remove(dp);
            }
            mDataFileDirectory = null;
            mXukedInFilDataProviderPaths.Clear();
            base.Clear();
        }
Example #7
0
 /// <summary>
 /// Unregister the <see cref="IManagedObject"/>. The object is then no longer managed by the <see cref="HoloFlowSceneManager"/>
 /// </summary>
 /// <param name="mObject"></param>
 public void UnregisterObject(IManagedObject mObject)
 {
     ManagedObjects.Remove(mObject);
 }
Example #8
0
 public override void Destroy(BasicLocus locus)
 {
     ManagedObjects.Remove(locus);
     locus.OnDestroyed();
 }