public override void Trigger(EditableView.ClickPosition.Sources source, EditableView pnlView, Transaction transaction) { List <FreeText> shapes = CurrentPage.SelectedShapes.OfType <FreeText>().ToList(); // new copy so we don't have problems editing while iterating if (shapes.Count == 0) { return; } CurrentPage.DeleteSelected(transaction); List <Shape> newList = new List <Shape>(); foreach (FreeText shp in shapes) { TextLine textLine = TextLine.FromFreeText(shp); transaction.Create(textLine); newList.Add(textLine); CurrentPage.AddNew(textLine, transaction); } CurrentPage.SelectOnly(newList); }