コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DevExpress.XtraRichEdit.API.Native.DocumentPosition pos = txtHtmlControl.Document.CaretPosition;
            SubDocument doc          = pos.BeginUpdateDocument();
            var         selectedText = property;
            string      propName     = string.Concat("{", externType, ".", selectedText, "}");

            if (string.IsNullOrEmpty(txtHtmlControl.Text))
            {
                txtHtmlControl.Text = propName + "    ";
            }
            else
            {
                doc.InsertText(pos, propName + "    ");
                pos.EndUpdateDocument(doc);
                var position = txtHtmlControl.Document.CreatePosition(pos.ToInt() + propName.Length);
                txtHtmlControl.Document.CaretPosition = pos;
            }
            txtHtmlControl.Focus();
        }
コード例 #2
0
 public Rectangle GetBoundsFromPosition(DevExpress.XtraRichEdit.API.Native.DocumentPosition pos);