public void Start() { //if (sl == null) //{ if (!timer.Enabled) { timer.Start(); } try { if (minElapsed == time && secElapsed == 0) { if (watch.IsRunning) { watch.Stop(); } watch.Reset(); watch.Start(); } } catch { } //} if (sl != null) { sl.SubscribeEvent(sl_SystemListenerEvent); } if (RotationEvent != null) { RotationEvent(this, new RotationEventArgs(RotationEventArgs.EventType.START, minElapsed, secElapsed)); } }
private oBoulderingTimer(EKBListener sl) { timer = new System.Timers.Timer(); timer.Interval = SEC_INT; timer.AutoReset = true; timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); mTimer = new Mutex(); timer1 = new System.Timers.Timer(); timer1.AutoReset = false; timer1.Interval = UPD_INT * SEC_INT; timer1.Stop(); timer1.Elapsed += new System.Timers.ElapsedEventHandler(t2_Tick); if (sl != null) { this.sl = sl; //this.sl.SystemListenerEvent += new SystemListener.SystemListenerEventHandler(sl_SystemListenerEvent); //this.sl.StartListening(); sl.SubscribeEvent(sl_SystemListenerEvent); } }