Esempio n. 1
0
        private void ChangeIsCurrentInVersionStract(bool isCurrentVersion, int index)
        {
            versionOfShape temp = allShapes[index];

            temp.isCurrentVersion = isCurrentVersion;
            allShapes[index]      = temp;
        }
Esempio n. 2
0
        private void ChangeCountInVersionStract(int count, int index)
        {
            versionOfShape temp = allShapes[index];

            temp.count       = count;
            allShapes[index] = temp;
        }
Esempio n. 3
0
        private Shape.Shape GetShapeForChanging()
        {
            Point[] helpPoint = new Point[allShapes[selectedShapesNumber].list[0].point.Length];
            for (int i = 0; i < helpPoint.Length; i++)
            {
                helpPoint[i].X = allShapes[selectedShapesNumber].list[0].point[i].X;
                helpPoint[i].Y = allShapes[selectedShapesNumber].list[0].point[i].Y;
            }

            if (allShapes[selectedShapesNumber].list.Count != allShapes[selectedShapesNumber].count + 1)
            {
                shape = CreateNewShape(allShapes[selectedShapesNumber].list[0].GetType().Name, helpPoint, allShapes[selectedShapesNumber].list[0].pen);
                if (selectedShapesNumber != allShapes.Count - 1)
                {
                    ChangeIsCurrentInVersionStract(false, selectedShapesNumber);
                    versionOfShape newVersionOfShape = new versionOfShape();
                    newVersionOfShape.count            = 1;
                    newVersionOfShape.prevVersionIndex = selectedShapesNumber;
                    newVersionOfShape.isCurrentVersion = true;
                    newVersionOfShape.list             = new List <Shape.Shape>();
                    allShapes.Add(newVersionOfShape);
                    selectedShapesNumber = allShapes.Count - 1;
                    ChangeCountInVersionStract(allShapes[selectedShapesNumber].count - 1, selectedShapesNumber);
                }
                allShapes[selectedShapesNumber].list.Insert(0, shape);
            }
            return(shape);
        }