Esempio n. 1
0
 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;
     }
 }
Esempio n. 3
0
        public override void Run()
        {
            TabPage page = WorkbenchSingleton.Workbench.FileTabControl.SelectedTab;

            if (page != null)
            {
                TextEditorControl textEditor = page.Controls[0] as TextEditorControl;
                textEditor.Undo();
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 5
0
 public void Undo(TextEditorControl editor)
 {
     editor.Undo();
 }
Esempio n. 6
0
 public void Undo()
 {
     textEditor.Undo();
 }
Esempio n. 7
0
 public void Undo()
 {
     textEditorControl.Undo();
 }
Esempio n. 8
0
 public void undo()
 {
     redoUndoPos -= 1; textBox.Undo();
 }