コード例 #1
0
ファイル: DetailPane.cs プロジェクト: drosenstark/KBase
 internal void Select(Selection selection)
 {
     Select(selection.Start, selection.Length);
 }
コード例 #2
0
ファイル: DetailPane.cs プロジェクト: drosenstark/KBase
 public void CopySpecial()
 {
     if (!Editable)
         return;
     Selection oldSelection = new Selection(SelectionStart, SelectionLength);
     string copyThis;
     if (Util.IsRichTextBoxBroken())
     {
         copyThis = Text.Substring(SelectionStart, SelectionLength);
     }
     else
     {
         copyThis = RtfConverter.Serialize(Rtf, SelectionStart, SelectionLength);
     }
     Clipboard.SetDataObject(new DataObject(DataFormats.StringFormat, copyThis));
     Select(oldSelection);
 }
コード例 #3
0
ファイル: DetailPane.cs プロジェクト: drosenstark/KBase
 public void FindText(string text, bool startFromBeginning, bool searchOtherSnippets)
 {
     int found = -1;
     Selection oldSelection = null;
     if (Editable)
     {
         oldSelection = new Selection(SelectionStart, SelectionLength);
         int startFrom = 0;
         if (!startFromBeginning)
             startFrom = SelectionStart + SelectionLength;
         found = Find(text, startFrom, RichTextBoxFinds.None);
     }
     if (found == -1 || (found == oldSelection.Start && text.Length == oldSelection.Length))
     {
         // careful!  this actually does the find in other snippets if
         // necessary
         if (!searchOtherSnippets || !FindInOtherSnippets(text))
         {
             MessageBox.Show("Text '" + text + "' not found.", MainForm.DialogCaption, MessageBoxButtons.OK);
         }
     }
     else
     {
         Select(found, text.Length);
         this.Focus();
         this.ScrollToCaret();
     }
 }
コード例 #4
0
ファイル: DetailPane.cs プロジェクト: TheProjecter/thekbase
 public void CopySpecial()
 {
     if (!Enabled)
         return;
     Selection oldSelection = new Selection(SelectionStart, SelectionLength);
     string copyThis = RtfConverter.Serialize(Rtf, SelectionStart,SelectionLength);
     Clipboard.SetDataObject(new DataObject(DataFormats.StringFormat, copyThis));
     Select(oldSelection);
 }