//		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);
            }
        }
示例#2
0
        protected override void UnExecuteCore()
        {
            if (AfterChild == null)
            {
                Parent.Children.Prepend(list);
            }
            else
            {
                Parent.Children.Append(AfterChild, list);
            }

            if (!BlockToFocusAfterUndoIsValid)
            {
                BlockToFocusAfterUndo = BlockActions.FindFirstFocusableBlock(list);
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
        public static void CopyBlocksBeforeBlock(IEnumerable <Block> blocksToCopy, Block beforeChild)
        {
            IEnumerable <Block> newBlocks = BlockActions.Clone(blocksToCopy);

            beforeChild.PrependBlocks(newBlocks);
        }
示例#5
0
        public static void CopyBlocksAfterBlock(IEnumerable <Block> blocksToCopy, Block afterChild)
        {
            IEnumerable <Block> newBlocks = BlockActions.Clone(blocksToCopy);

            afterChild.AppendBlocks(newBlocks);
        }