public override void Flatten(UndoBuffer undoBuffer) { // change this from a text object to a group var newContainer = new GroupObject3D(); newContainer.CopyProperties(this, Object3DPropertyFlags.All); foreach (var child in this.Children) { newContainer.Children.Add(child.Clone()); } undoBuffer.AddAndDo(new ReplaceCommand(new[] { this }, new[] { newContainer })); }
public override void Flatten(UndoBuffer undoBuffer) { // change this from a text object to a group var newContainer = new GroupObject3D(); newContainer.CopyProperties(this, Object3DPropertyFlags.All); int index = 0; foreach (var child in this.Children) { var clone = child.Clone(); var newName = index < NameToWrite.Length ? NameToWrite[index++].ToString() : "Letter".Localize(); clone.Name = MapIfSymbol(newName); newContainer.Children.Add(clone); } undoBuffer.AddAndDo(new ReplaceCommand(new[] { this }, new[] { newContainer })); newContainer.Name = this.Name + " - " + "Flattened".Localize(); }