public void Undo() { if (txtEditCtl != null) { txtEditCtl.Undo(); } }
private void UndotoolStripButton_Click(object sender, EventArgs e) { textEditor.Undo(); if (!textEditor.Document.UndoStack.CanUndo) { changeCode = false; } }
public override void Run() { TabPage page = WorkbenchSingleton.Workbench.FileTabControl.SelectedTab; if (page != null) { TextEditorControl textEditor = page.Controls[0] as TextEditorControl; textEditor.Undo(); } }
/// <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; } }
public void Undo(TextEditorControl editor) { editor.Undo(); }
public void Undo() { textEditor.Undo(); }
public void Undo() { textEditorControl.Undo(); }
public void undo() { redoUndoPos -= 1; textBox.Undo(); }