Start() public method

public Start ( System.TimeSpan repeat ) : void
repeat System.TimeSpan
return void
Exemplo n.º 1
0
 public static UVTimer Every(Loop loop, TimeSpan repeat, Action callback)
 {
     var timer = new UVTimer(loop);
     timer.Tick += callback;
     timer.Start(repeat, repeat);
     return timer;
 }
Exemplo n.º 2
0
        public static UVTimer Every(Loop loop, TimeSpan repeat, Action callback)
        {
            var timer = new UVTimer(loop);

            timer.Tick += callback;
            timer.Start(repeat, repeat);
            return(timer);
        }
Exemplo n.º 3
0
        public StatusBarTemplate(QuasselClient client)
        {
            Client = client;

            Client.BufferSyncer.Synced += (obj) => {
                Invalid = true;
            };

            var timer = new UVTimer();
            timer.Tick += () => Invalid = true;
            timer.Start(TimeSpan.Zero, TimeSpan.FromSeconds(1));
        }
Exemplo n.º 4
0
        public static UVTimer Once(Loop loop, TimeSpan timeout, Action callback)
        {
            var timer = new UVTimer(loop);

            timer.Tick += () => {
                if (callback != null)
                {
                    callback();
                }
                timer.Close();
            };
            timer.Start(timeout, TimeSpan.Zero);
            return(timer);
        }
Exemplo n.º 5
0
		public Fanbar(string root, int id)
		{
			Root = root;
			ID = id;
			Value = -1;

			timer = new UVTimer(Application.Loop);

			Get(PWM, (val) => {
				Invalid = true;
				Value = val;
			});


			timer.Start(TimeSpan.FromSeconds(1), () => {
				Get(FanInput, (val) => RPM = val);
			});
		}
Exemplo n.º 6
0
        public static UVTimer Times(Loop loop, int times, TimeSpan repeat, Action <int> callback)
        {
            var timer = new UVTimer(loop);
            int i     = 0;

            timer.Tick += () => {
                i++;
                if (callback != null)
                {
                    callback(i);
                }
                if (i >= times)
                {
                    timer.Close();
                }
            };
            timer.Start(repeat, repeat);
            return(timer);
        }
Exemplo n.º 7
0
 public static UVTimer Once(Loop loop, TimeSpan timeout, Action callback)
 {
     var timer = new UVTimer(loop);
     timer.Tick += () => {
         if (callback != null) {
             callback();
         }
         timer.Close();
     };
     timer.Start(timeout, TimeSpan.Zero);
     return timer;
 }
Exemplo n.º 8
0
 public static UVTimer Times(Loop loop, int times, TimeSpan repeat, Action<int> callback)
 {
     var timer = new UVTimer(loop);
     int i = 0;
     timer.Tick += () => {
         i++;
         if (callback != null) {
             callback(i);
         }
         if (i >= times) {
             timer.Close();
         }
     };
     timer.Start(repeat, repeat);
     return timer;
 }