public virtual void AddToBeginning(IEnumerable <Block> blocksToAdd) { Block head = this.Children.Head; if (head != null) { head.PrependBlocks(blocksToAdd); } else { this.Add(blocksToAdd); } }
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(); }
public static void CopyBlocksBeforeBlock(IEnumerable<Block> blocksToCopy, Block beforeChild) { IEnumerable<Block> newBlocks = BlockActions.Clone(blocksToCopy); beforeChild.PrependBlocks(newBlocks); }
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); } }