Esempio n. 1
0
        private TraverseOptions InternalAdd(object descendant)
        {
            if (descendant == null)
            {
                throw new ArgumentNullException("descendant");
            }

            var collectionChanged = descendant as INotifyCollectionChanged <object>;

            if (collectionChanged != null)
            {
                workingExpandables.Add(collectionChanged);
            }

            var queryable = descendant as ISpatialQueryable;

            if (queryable != null)
            {
                // Choose the right scene manager for the target object
                if (currentSceneManagerForAddition != null)
                {
                    currentSceneManagerForAddition.Add(queryable);
                }
                else
                {
                    defaultSceneManager.Add(queryable);
                }
            }

            TrackObject(descendant);
            OnAddedToScene(descendant);

            var addedToScene = AddedToScene;

            if (addedToScene != null)
            {
                addedToScene(descendant);
            }

            return(TraverseOptions.Continue);
        }