Exemplo n.º 1
0
        public static RemoveBlocksAction DeleteBlock(Block blockToDelete)
        {
            RemoveBlocksAction action = new RemoveBlocksAction(blockToDelete.Parent);

            action.PrepareBlocks(blockToDelete);
            return(action);
        }
Exemplo n.º 2
0
 public static RemoveBlocksAction DeleteBlocks(IEnumerable<Block> blocksToDelete)
 {
     Param.CheckNotNull(blocksToDelete, "blocksToDelete");
     Block first = Common.Head<Block>(blocksToDelete);
     Param.CheckNotNull(first, "first");
     if (first.ActionManager == null)
     {
         return null;
     }
     RemoveBlocksAction action = new RemoveBlocksAction(first.Parent);
     action.PrepareBlocks(blocksToDelete);
     return action;
 }
Exemplo n.º 3
0
        public static RemoveBlocksAction DeleteBlocks(IEnumerable <Block> blocksToDelete)
        {
            Param.CheckNotNull(blocksToDelete, "blocksToDelete");
            Block first = Common.Head <Block>(blocksToDelete);

            Param.CheckNotNull(first, "first");
            if (first.ActionManager == null)
            {
                return(null);
            }
            RemoveBlocksAction action = new RemoveBlocksAction(first.Parent);

            action.PrepareBlocks(blocksToDelete);
            return(action);
        }
Exemplo n.º 4
0
        public static void DeleteBlock(Block block)
        {
            if (block == null || block.Parent == null)
            {
                return;
            }

            if (block.Root != null && block.Root.ActionManager != null)
            {
                RemoveBlocksAction action = new RemoveBlocksAction(block.Parent);
                action.PrepareBlocks(block.GetBlocksToDelete());
                block.Root.ActionManager.RecordAction(action);
            }
            else
            {
                block.Parent.Children.Delete(block.GetBlocksToDelete());
            }
        }
Exemplo n.º 5
0
        public static void DeleteBlock(Block block)
        {
            if (block == null || block.Parent == null)
            {
                return;
            }

            if (block.Root != null && block.Root.ActionManager != null)
            {
                RemoveBlocksAction action = new RemoveBlocksAction(block.Parent);
                action.PrepareBlocks(block.GetBlocksToDelete());
                block.Root.ActionManager.RecordAction(action);
            }
            else
            {
                block.Parent.Children.Delete(block.GetBlocksToDelete());
            }
        }
Exemplo n.º 6
0
 public static RemoveBlocksAction DeleteBlock(Block blockToDelete)
 {
     RemoveBlocksAction action = new RemoveBlocksAction(blockToDelete.Parent);
     action.PrepareBlocks(blockToDelete);
     return action;
 }
Exemplo n.º 7
0
 public void PrepareBlockToRemove(Block block)
 {
     RemoveAction.PrepareBlocks(block);
 }