/// <summary> /// Splits the given composite shape into independent shapes. /// </summary> public void SplitCompositeShape(Diagram diagram, Shape compositeShape) { if (diagram == null) throw new ArgumentNullException("diagram"); if (compositeShape == null) throw new ArgumentNullException("compositeShape"); if (compositeShape == null) throw new ArgumentNullException("compositeShape"); Debug.Assert(!(compositeShape is IShapeGroup)); // Add grouped shapes to shape buffer for selecting them later shapeBuffer.Clear(); shapeBuffer.AddRange(compositeShape.Children); shapeBuffer.Add(compositeShape); ICommand cmd = new SplitCompositeShapeCommand(diagram, diagram.GetShapeLayers(compositeShape), compositeShape); Project.ExecuteCommand(cmd); shapeBuffer.Clear(); }