Ejemplo n.º 1
0
        public void Move()
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format(@"Moving: {0}
", DescribeMoves()));
            }
#endif

            // TODO: CreatingContentPane pane has already been set from the outside (the caller of this method)
            // that is because this flag has to be set not only for mover operations, but also for "manual" aditions
            // so we must rethink if this is to be used also here (it's redundant)

            List <DisplayListMember> childrenToTransfer = new List <DisplayListMember>();

            for (int i = 0; i < _numberOfChildrenToMove; i++)
            {
                childrenToTransfer.Add(_docFrom.QChildren[i]);
            }

            foreach (DisplayListMember child in childrenToTransfer)
            {
                /**
                 * Note: we have to use container's AddChild/RemoveChild stuff, because else the control won't initialize properly and its Visible will be false! // 20130507
                 * */
                if (null != _docFrom)
                {
                    _docFrom.RemoveChild(child);
                }

                if (null != _docTo)
                {
                    _docTo.AddChild(child);
                }
            }

#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format(@"Moved: {0}
", DescribeMoves()));
            }
#endif

            if (null != _docFrom)
            {
                _docFrom.InvalidateDrawingList();
            }
            if (null != _docTo)
            {
                _docTo.InvalidateDrawingList();
            }
        }