Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- processing large text in C#
- public void Process()
- {
- string[] lines;
- string line;
- string foo = " baa";
- if (richTextBox1.InvokeRequired)
- {
- lines = (string[])Invoke((ReadLines)delegate
- {
- return /* read .Lines[] from richTextBox1 */
- });
- int max = lines.Length;
- for (int i = 0; i < max; i++)
- {
- line = lines[i];
- if (..)
- {
- lines[i] += "foo";
- }
- }
- Invoke((Update)delegate
- {
- /* set new lines to RichTextBox1 */
- });
- }
- }
- Thread th1 = new Thread(Process);
- th1.Start();
Add Comment
Please, Sign In to add comment