// private IEnumerable<Block> ReversedList() // { // LinkedListNode<Block> current = this.list.Last; // while (current != null) // { // yield return current.Value; // current = current.Previous; // } // } #endregion #region Execute protected override void ExecuteCore() { BlockActions.EnsureBlocksHangInTheAir(list); Parent.Children.Prepend(BeforeChild, list); if (!BlockToFocusIsValid) { BlockToFocus = BlockActions.FindFirstFocusableBlock(list); } }
protected override void UnExecuteCore() { if (AfterChild == null) { Parent.Children.Prepend(list); } else { Parent.Children.Append(AfterChild, list); } if (!BlockToFocusAfterUndoIsValid) { BlockToFocusAfterUndo = BlockActions.FindFirstFocusableBlock(list); } }
protected override void ExecuteCore() { BlockActions.EnsureBlocksHangInTheAir(list); if (AfterChild != null) { Parent.Children.Append(AfterChild, list); } else { Parent.Children.Add(list); } if (!BlockToFocusIsValid) { BlockToFocus = BlockActions.FindFirstFocusableBlock(list); } }
public static void CopyBlocksBeforeBlock(IEnumerable <Block> blocksToCopy, Block beforeChild) { IEnumerable <Block> newBlocks = BlockActions.Clone(blocksToCopy); beforeChild.PrependBlocks(newBlocks); }
public static void CopyBlocksAfterBlock(IEnumerable <Block> blocksToCopy, Block afterChild) { IEnumerable <Block> newBlocks = BlockActions.Clone(blocksToCopy); afterChild.AppendBlocks(newBlocks); }