예제 #1
0
 public void Undo()
 {
     if (txtEditCtl != null)
     {
         txtEditCtl.Undo();
     }
 }
예제 #2
0
 private void UndotoolStripButton_Click(object sender, EventArgs e)
 {
     textEditor.Undo();
     if (!textEditor.Document.UndoStack.CanUndo)
     {
         changeCode = false;
     }
 }
예제 #3
0
        public override void Run()
        {
            TabPage page = WorkbenchSingleton.Workbench.FileTabControl.SelectedTab;

            if (page != null)
            {
                TextEditorControl textEditor = page.Controls[0] as TextEditorControl;
                textEditor.Undo();
            }
        }
예제 #4
0
        /// <summary>
        /// 代码窗口弹出菜单事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void codeContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            switch (e.ClickedItem.Name)
            {
            case "copyToolStripMenuItem":
            {
                codeTextEditorControl.ActiveTextAreaControl.TextArea.ClipboardHandler.Copy(null, null);
                break;
            }

            case "cutToolStripMenuItem":
            {
                codeTextEditorControl.ActiveTextAreaControl.TextArea.ClipboardHandler.Cut(null, null);
                break;
            }

            case "pasteToolStripMenuItem":
            {
                codeTextEditorControl.ActiveTextAreaControl.TextArea.ClipboardHandler.Paste(null, null);
            };
                break;

            case "undoToolStripMenuItem":
            {
                if (codeTextEditorControl.EnableUndo)
                {
                    codeTextEditorControl.Undo();
                }
            } break;

            case "redoToolStripMenuItem":
            {
                if (codeTextEditorControl.EnableRedo)
                {
                    codeTextEditorControl.Redo();
                }
            }
            break;

            case "selectallToolStripMenuItem":
            {
                TextArea textArea   = codeTextEditorControl.ActiveTextAreaControl.TextArea;
                Point    startPoint = new Point(0, 0);
                Point    endPoint   = codeTextEditorControl.Document.OffsetToPosition(codeTextEditorControl.Document.TextLength);
                textArea.SelectionManager.SetSelection(new DefaultSelection(codeTextEditorControl.Document, startPoint, endPoint));
            }
            break;
            }
        }
예제 #5
0
 public void Undo(TextEditorControl editor)
 {
     editor.Undo();
 }
예제 #6
0
 public void Undo()
 {
     textEditor.Undo();
 }
예제 #7
0
 public void Undo()
 {
     textEditorControl.Undo();
 }
예제 #8
0
 public void undo()
 {
     redoUndoPos -= 1; textBox.Undo();
 }