Guest User

Untitled

a guest
Jul 13th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1.     public class Yoba
  2.     {
  3.         private readonly MainWindow _window;
  4.         private Timer timer;
  5.  
  6.         public Yoba(MainWindow window)
  7.         {
  8.             _window = window;
  9.  
  10.             timer = new Timer(1000);
  11.             timer.Elapsed += TimerOnElapsed;
  12.             timer.Enabled = true;
  13.         }
  14.  
  15.         private void TimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
  16.         {
  17.             _window.Dispatcher.Invoke(UpdateTextBox);
  18.         }
  19.  
  20.         private void UpdateTextBox()
  21.         {
  22.             _window.tb.Text += "yoba, eto ti?" + Environment.NewLine;
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment