Ejemplo n.º 1
0
        protected void TerminateEditing()
        {
            BaseController canvasController = ServiceManager.Get <IFlowSharpCanvasService>().ActiveController;

            if (editBox != null)
            {
                editBox.KeyPress -= OnEditBoxKey;
                string  oldVal = shapeBeingEdited.Text;
                string  newVal = editBox.Text;
                TextBox tb     = editBox;
                editBox = null;     // set editBox to null so the remove, which fires a LoseFocus event, doesn't call into TerminateEditing again!
                shapeBeingEdited.EndEdit(newVal, oldVal);
                canvasController.Canvas.Controls.Remove(tb);
            }
        }