public void Register(int timeout, ITimerClient client) { if (stopwatch.Elapsed > TimeSpan.FromSeconds(timeout)) { client.TimeOut(); } }
public void Unsubscribe(ITimerClient timerClient) { if (clients.Count == 1) { timer.Stop(); } clients.Remove(timerClient); }
public void Subscribe(ITimerClient timerClient) { clients.Add(timerClient); if (clients.Count == 1) { timer.Start(); } }
public void Register(int timeout, ITimerClient client) { _client = client; Task.Factory.StartNew(() => { System.Threading.Thread.Sleep(timeout); TimeOut(); }); }
public void start_notifying(ITimerClient client_to_be_notified, TimeSpan span) { stop_notifying(client_to_be_notified); var timer = factory.create_for(span); timer.Elapsed += (sender, args) => client_to_be_notified.notify(); timer.Start(); timers[client_to_be_notified] = timer; }
public void Register(int s, ITimerClient c) { _secunds = s; }
public void Unsubscribe(ITimerClient timerClient) { if (clients.Count == 1) timer.Stop(); clients.Remove(timerClient); }
public void Subscribe(ITimerClient timerClient) { clients.Add(timerClient); if (clients.Count == 1) timer.Start(); }
public void Register(int timeout, int timeOutId, ITimerClient timerClient) { /* * Code */ }
public void stop_notifying(ITimerClient client_to_stop_notifying) { if (!timers.ContainsKey(client_to_stop_notifying)) return; timers[client_to_stop_notifying].Stop(); timers[client_to_stop_notifying].Dispose(); }
public void Register(int timeout, ITimerClient client) { /* CODE */ }
public void Register(int timeout, int timeoutId, ITimerClient client) { client.Timeout(timeoutId); }