コード例 #1
0
 internal static void InsertText(string insertedText, FastColoredTextBox tb)
 {
     try
     {
         tb.Selection.BeginUpdate();
         char cc = '\x0';
         if (tb.LinesCount == 0)
         {
             InsertCharCommand.InsertLine(tb);
         }
         tb.ExpandBlock(tb.Selection.Start.iLine);
         foreach (char c in insertedText)
         {
             InsertCharCommand.InsertChar(c, ref cc, tb);
         }
         tb.needRecalc = true;
     }
     finally {
         tb.Selection.EndUpdate();
     }
 }