Beispiel #1
0
        public PictureLayout CopyLayout(int index)
        {
            watched = false;
            PictureLayout pictureLayout    = Layouts[index];
            PictureLayout newPictureLayout = null;

            if (pictureLayout is StandardLayout standardLayout)
            {
                newPictureLayout = new StandardLayout(standardLayout)
                {
                    Name = string.Format("{0} 复制", standardLayout.Name)
                };
            }
            else if (pictureLayout is PureLayout pureLayout)
            {
                newPictureLayout = new PureLayout(pureLayout)
                {
                    Name = string.Format("{0} 复制", pureLayout.Name)
                };
            }
            Layouts.Insert(index, newPictureLayout);
            watched = true;
            UndoManager.AddUndoData(new CMD_DeleteLayout(newPictureLayout, this, index));
            return(newPictureLayout);
        }
Beispiel #2
0
        public void Move(ILayout source, int insert_index)
        {
            var index = Layouts.IndexOf(source);

            Layouts.Remove(source);
            if (index < insert_index)
            {
                --insert_index;
            }
            Layouts.Insert(insert_index, source);
        }
Beispiel #3
0
        public PureLayout NewPureLayout(int insertIndex, int RenderBufferNum)
        {
            PureLayout pureLayout = new PureLayout(DeviceResources)
            {
                BlendMode       = DefaultBlendMode,
                RenderBufferNum = RenderBufferNum,
                guid            = System.Guid.NewGuid(),
                Name            = string.Format("图层 {0}", Layouts.Count + 1)
            };

            watched = false;
            Layouts.Insert(insertIndex, pureLayout);
            watched = true;
            UndoManager.AddUndoData(new CMD_DeleteLayout(pureLayout, this, insertIndex));

            return(pureLayout);
        }
Beispiel #4
0
        public StandardLayout NewStandardLayout(int insertIndex, int RenderBufferNum)
        {
            StandardLayout standardLayout = new StandardLayout(DeviceResources)
            {
                PaintingTexture     = PaintingTexture,
                PaintingTextureTemp = PaintingTextureTemp,
                BlendMode           = DefaultBlendMode,
                RenderBufferNum     = RenderBufferNum,
                guid = System.Guid.NewGuid(),
                Name = string.Format("图层 {0}", Layouts.Count + 1)
            };

            watched = false;
            Layouts.Insert(insertIndex, standardLayout);
            watched = true;
            UndoManager.AddUndoData(new CMD_DeleteLayout(standardLayout, this, insertIndex));

            return(standardLayout);
        }