Exemplo n.º 1
0
        private void RichTextBoxContent_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Modifiers == Keys.ControlKey)
            {
                switch (e.KeyData)
                {
                case Keys.C:
                    RichTextBoxContent.Copy();
                    break;

                case Keys.A:
                    RichTextBoxContent.SelectAll();
                    break;
                }
            }
        }
        private void ControllerOnOverlayContentUpdated(bool fromView, string content)
        {
            if (RichTextBoxContent.Dispatcher.CheckAccess())
            {
                if (_isClosed)
                {
                    return;
                }
                var textRange = new TextRange(RichTextBoxContent.Document.ContentEnd,
                                              RichTextBoxContent.Document.ContentEnd);
                textRange.Load(new MemoryStream(Encoding.UTF8.GetBytes(content)), DataFormats.Rtf);
                textRange.ApplyPropertyValue(TextElement.FontSizeProperty, RichTextBoxContent.FontSize);

                RichTextBoxContent.ScrollToEnd();
            }
            else
            {
                RichTextBoxContent.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(delegate
                {
                    ControllerOnOverlayContentUpdated(fromView, content);
                }));
            }
        }
Exemplo n.º 3
0
 private void SelectAllCtrlCToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     RichTextBoxContent.SelectAll();
 }
Exemplo n.º 4
0
 private void CopyCtrlCToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     RichTextBoxContent.Copy();
 }