Пример #1
0
 public override void OnSave()
 {
     if ((!FileContentsBox.ReadOnly) && FileContentsBox.Modified && System.IO.File.Exists(FullFileName))
     {
         FileContentsBox.SaveFile(FullFileName, RichTextBoxStreamType.PlainText);
     }
 }
Пример #2
0
 private void SearchString(string text)
 {
     if (text.Length > 0)
     {
         FileContentsBox.SelectionBackColor = Color.FromKnownColor(KnownColor.Control);
         FileContentsBox.SelectionStart     = FileContentsBox.SelectionStart + 1;
         int indexToText = FileContentsBox.Find(text, FileContentsBox.SelectionStart, RichTextBoxFinds.None);
         if (indexToText == -1)
         {
             FileContentsBox.SelectionStart = 0;
         }
         if (indexToText >= 0)
         {
             FileContentsBox.SelectionBackColor = Color.LightBlue;
             FileContentsBox.ScrollToCaret();
         }
     }
 }