Advertisement
wingman007

C#EventDriven_Time

Sep 29th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace EventDriven1a
  8. {
  9.  
  10.     public delegate void TickEvenetHanler(object sender, EventArgs e);
  11.     class Time
  12.     {
  13.         public event TickEvenetHanler Tick;
  14.  
  15.         public void Start()
  16.         {
  17.             while (true){
  18.  
  19.                 System.Threading.Thread.Sleep(1000);
  20.  
  21.                 if (Tick != null) {
  22.                     Tick(this, EventArgs.Empty);
  23.                 }
  24.  
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement