Exemplo n.º 1
0
        internal void InsertCore(int index, SnipPagePart part)
        {
            part.ParentContainer = ParentContainer;
            part.Level           = ParentContainer.Level + 1;

            _innerList.Insert(index, part);

            ///维护SnipPagePart的Index
            for (int i = index; i < _innerList.Count; i++)
            {
                _innerList[i].Index = i;
            }

            ParentContainer.LayoutParts();
        }
Exemplo n.º 2
0
        internal void RemoveCore(SnipPagePart part)
        {
            int            index         = _innerList.IndexOf(part);
            IPartContainer partContainer = part.ParentContainer;

            part.ParentContainer = null;
            bool bl = _innerList.Remove(part);

            if (bl)
            {
                ///维护SnipPagePart的Index
                for (int i = index; i < _innerList.Count; i++)
                {
                    _innerList[i].Index = i;
                }

                ///重新布局
                partContainer.LayoutParts();
            }
        }