Ejemplo n.º 1
0
        public virtual void AddToBeginning(IEnumerable <Block> blocksToAdd)
        {
            Block head = this.Children.Head;

            if (head != null)
            {
                head.PrependBlocks(blocksToAdd);
            }
            else
            {
                this.Add(blocksToAdd);
            }
        }
Ejemplo n.º 2
0
        public static void Prepend(Block beforeBlock, params Block[] blocksToInsert)
        {
            if (beforeBlock == null
                || beforeBlock.Parent == null
                || blocksToInsert == null
                || blocksToInsert.Length == 0)
            {
                return;
            }

            beforeBlock.PrependBlocks(blocksToInsert);
            //ActionBuilder a = new ActionBuilder(beforeBlock.Root);
            //a.PrependBlocks(beforeBlock, blocksToInsert);
            //a.Run();
        }
Ejemplo n.º 3
0
 public static void CopyBlocksBeforeBlock(IEnumerable<Block> blocksToCopy, Block beforeChild)
 {
     IEnumerable<Block> newBlocks = BlockActions.Clone(blocksToCopy);
     beforeChild.PrependBlocks(newBlocks);
 }
Ejemplo n.º 4
0
 public static void MoveBlocksBeforeBlock(IEnumerable<Block> blocksToMove, Block beforeChild)
 {
     using (beforeChild.Transaction())
     {
         Block toFocus = Common.Head(blocksToMove);
         Delete(blocksToMove);
         beforeChild.PrependBlocks(blocksToMove);
         toFocus.SetFocus(SetFocusOptions.General);
     }
 }