/// <summary>
        /// 这个方法讲已经选择的图形组成一个群组。
        /// </summary>
        public void doGroup()
        {
            //首先生成群组对象
            ShapeGroup group = new ShapeGroup(CurrentSelRect.arrlistShapeEle);

            CurrentSelRect.cancelAllSelect();//取消所有选择

            CurrentSelRect.addShapeEle(group);//再选择这个。

            //如下再在myshapes 中删除那些图形,并加上这一个。

            int intIndex=0;

            foreach (ShapeEle item in group.arrlistShapeEle)
            {
                intIndex = myShapes.IndexOf(item);
                myShapes.deleteShapeEle(item);

            }

            if (intIndex < 0)
                intIndex = 0;

            myShapes.addShapeEle(group, intIndex);

            //将这个作为已选择对象
            CurrentSelRect = new ShapeSelRect();
            CurrentSelRect.addShapeEle(group);
            Option = "select";

            saveOperatingRecord();
        }
Beispiel #2
0
        public override ShapeEle DeepClone()
        {
            ArrayList arrlist = new ArrayList();

            foreach (ShapeEle item in arrlistShapeEle)
            {
                arrlist.Add(item.DeepClone());
            }

            ShapeGroup shapeEle = new ShapeGroup(arrlist);

            return shapeEle;

            //throw new NotImplementedException();
        }