Beispiel #1
0
        public void DoDelete(EditorCanvas editorCanvas)
        {
            if (editorCanvas == null)
            {
                return;
            }

            if (editorCanvas.FocusManager.IsEditorFocused)
            {
                var focus = editorCanvas.FocusManager.Focus as StyledTextFocus;
                if (focus != null)
                {
                    focus.RemoveForward();
                }
            }
            else if (editorCanvas.CanDelete())
            {
                var selecteds = editorCanvas.SelectionManager.SelectedEditors;
                var bundle    = new EditorBundle(selecteds);
                var req       = new RemoveRequest();
                bundle.PerformCompositeRequest(req, editorCanvas.CommandExecutor);
            }
        }