Guest User

Untitled

a guest
Aug 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. processing large text in C#
  2. public void Process()
  3. {
  4.  
  5. string[] lines;
  6. string line;
  7. string foo = " baa";
  8. if (richTextBox1.InvokeRequired)
  9. {
  10.  
  11. lines = (string[])Invoke((ReadLines)delegate
  12. {
  13. return /* read .Lines[] from richTextBox1 */
  14. });
  15. int max = lines.Length;
  16.  
  17. for (int i = 0; i < max; i++)
  18. {
  19. line = lines[i];
  20. if (..)
  21. {
  22. lines[i] += "foo";
  23. }
  24. }
  25.  
  26. Invoke((Update)delegate
  27. {
  28. /* set new lines to RichTextBox1 */
  29. });
  30.  
  31. }
  32. }
  33.  
  34. Thread th1 = new Thread(Process);
  35. th1.Start();
Add Comment
Please, Sign In to add comment