Ejemplo n.º 1
0
 public static void SelectText(this TextBoxBase self, Range range)
 {
     self.SelectionStart = range.Begin;
     self.SelectionLength = range.Length;
 }
Ejemplo n.º 2
0
 public static void SelectAndApply(this RichTextBox self, Range r, Proc p)
 {
     Range old = SelectedRange(self);
     try
     {
         SelectText(self, r);
         p();
     }
     finally
     {
         SelectText(self, old);
     }
 }
Ejemplo n.º 3
0
 public static void ColorText(this RichTextBox self, Range r, Color c)
 {
     self.SelectAndApply(r, () => { self.SelectionColor = c; });
 }
Ejemplo n.º 4
0
 public static Match MatchWithin(this string self, Regex regex, Range r)
 {
     return regex.Match(self.Substring(r));
 }
Ejemplo n.º 5
0
 public static String Substring(this String self, Range range)
 {
     return self.Substring(range.Begin, range.Length);
 }
Ejemplo n.º 6
0
 public static string GetText(this TextBoxBase self, Range r)
 {
     return self.Text.Substring(r);
 }
Ejemplo n.º 7
0
 public static void SetTextColor(this RichTextBox self, Color c, Range r)
 {
     SelectAndApply(self, r, () => self.SelectionColor = c);
 }