示例#1
0
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var item = (ToolStripMenuItem)sender;

            if (item == undoToolStripMenuItem)
            {
                Output.Undo();
            }
            if (item == cutToolStripMenuItem)
            {
                Output.Cut();
            }
            if (item == copyToolStripMenuItem)
            {
                Output.Copy();
            }

            // I prefer the text bracketed -- suppose this could be optional
            if (item == copyToSnippetsToolStripMenuItem)
            {
                Snippets.AppendText("\r\n" + Output.SelectedText + "\r\n");
            }
            if (item == pasteToolStripMenuItem)
            {
                Output.Paste();
            }
            if (item == deleteToolStripMenuItem)
            {
                Output.SelectedText = string.Empty;
            }
            if (item == selectAllToolStripMenuItem)
            {
                Output.SelectAll();
            }
        }