Beispiel #1
0
        /// <summary>
        /// 组合
        /// </summary>
        private void Composite_Click(object sender, RoutedEventArgs e)
        {
            CompositeShape compShape = new CompositeShape();

            foreach (var shape in _selectedShapes)
            {
                shape.Parent = compShape;
                compShape.Add(shape);
            }
            compShape.Draw();
        }
Beispiel #2
0
        private void GroupSelectedShapes()
        {
            var members = GetSelectedShapes();

            if (members.Count < 2)
            {
                return;                    //Group has no effect
            }
            CompositeShape compS = new CompositeShape(members);

            compS.Select();
            shapes.Add(compS);
            foreach (Shape m in members)
            {
                shapes.Remove(m);
                m.Deselect();
            }
            Refresh();
        }