Пример #1
0
 public ReplaceBlocksAction(Block afterChild)
     : base(afterChild.Root)
 {
     Parent = afterChild.Parent;
     AddAction = new AddBlocksAction(afterChild.Parent, afterChild);
     RemoveAction = new RemoveBlocksAction(Parent);
 }
Пример #2
0
        public static RemoveBlocksAction DeleteBlock(Block blockToDelete)
        {
            RemoveBlocksAction action = new RemoveBlocksAction(blockToDelete.Parent);

            action.PrepareBlocks(blockToDelete);
            return(action);
        }
Пример #3
0
 public ReplaceBlocksAction(Block afterChild)
     : base(afterChild.Root)
 {
     Parent       = afterChild.Parent;
     AddAction    = new AddBlocksAction(afterChild.Parent, afterChild);
     RemoveAction = new RemoveBlocksAction(Parent);
 }
Пример #4
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;
 }
Пример #5
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);
        }
Пример #6
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());
            }
        }
Пример #7
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());
            }
        }
Пример #8
0
 public static RemoveBlocksAction DeleteBlock(Block blockToDelete)
 {
     RemoveBlocksAction action = new RemoveBlocksAction(blockToDelete.Parent);
     action.PrepareBlocks(blockToDelete);
     return action;
 }