Esempio n. 1
0
        public Boolean Unlock(LockableBinaryNode node)
        {
            if (node.CanLockedOrUnLocked())
            {
                node.IsLocked = false;
                LockableBinaryNode current = node.Parent;

                while (current != null)
                {
                    current.LockedDecendanteCount--;
                    current = current.Parent;
                }
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        private Boolean CanLockedOrUnLocked()
        {
            if (LockedDecendanteCount > 0)
            {
                return(false);
            }

            LockableBinaryNode current = Parent;

            while (current != null)
            {
                if (current.IsLocked)
                {
                    return(false);
                }
                current = current.Parent;
            }
            return(true);
        }