Exemplo n.º 1
0
        /// <inheritdoc />
        protected override Task OnLockingRequested(bool @lock, bool recursive)
        {
            IsLocked = @lock;
            if (!recursive)
            {
                return(Task.CompletedTask);
            }

            // Update IsLocked property recursively
            foreach (var entity in TransformChildren.BreadthFirst(x => x.TransformChildren))
            {
                entity.IsLocked = @lock;
            }
            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        protected override Task OnLoadingRequested(bool load, bool recursive)
        {
            // TODO: we don't support explicit loading request on entities for the moment.
            // TODO: in the future to allow loading/unloading a specific entity, we will need to call AddPart/RemovePart here
            // TODO: and handle all issues releated to references (i.e. what happens when we unload an entity that is still referenced by another loaded entity)
            IsLoaded = load;
            if (!recursive)
            {
                return(Task.CompletedTask);
            }

            // Update IsLoaded property recursively
            foreach (var entity in TransformChildren.BreadthFirst(x => x.TransformChildren))
            {
                entity.IsLoaded = load;
            }
            return(Task.CompletedTask);
        }