public static RemoveBlocksAction DeleteBlock(Block blockToDelete) { RemoveBlocksAction action = new RemoveBlocksAction(blockToDelete.Parent); action.PrepareBlocks(blockToDelete); return(action); }
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; }
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); }
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()); } }
public static RemoveBlocksAction DeleteBlock(Block blockToDelete) { RemoveBlocksAction action = new RemoveBlocksAction(blockToDelete.Parent); action.PrepareBlocks(blockToDelete); return action; }
public void PrepareBlockToRemove(Block block) { RemoveAction.PrepareBlocks(block); }