private void tbFilter_KeyPress(object sender, KeyPressEventArgs e) { if (filterTimer != null) { filterTimer.Dispose(); } filterTimer = new System.Threading.Timer(new TimerCallback(PerformFiltering), null, filterDelay, Timeout.Infinite); }
private async void SecondTimer(object obj) { SecondCount--; if ((SecondCount < 60) && (SecondCount > 0)) { string text = SecondCount + " " + (SecondCount == 1 ? "second" : "seconds"); await WrapGuiAction(() => labUpdateTime.Text = text); } else if (SecondCount >= 60) { int val = (SecondCount + 30) / 60; string text = val + " " + (val == 1 ? "minute" : "minutes"); await WrapGuiAction(() => labUpdateTime.Text = text); } else { secondtimer.Dispose(); secondtimer = null; await RefreshUpdates(); } }
public void Terminate() { if (parser != null && parser.IsAlive) { parser.Abort(); } if (watcher != null) { watcher.Dispose(); } //if (reader != null) // reader.Close(); Progress.OnCancelled -= new CancelledDelegate(Progress_OnCancelled); lvEntries.VirtualListSize = 0; lvEntries.VirtualMode = false; buffer.Clear(); visibleItems.Clear(); knownCategories.Clear(); hiddenCategories.Clear(); }
private void timercallback(object value) { //disable timer.. Debug.Print("timercallback"); delaytimer.Dispose(); delaytimer = null; //invoke the routine to initialize the game state... if (!ShownAsAbout) { quickthread = new Thread(threadinitroutine); quickthread.Start(); } bobberthread = new Thread(BobberThread); bobberthread.Start(); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (m_Started) { Stop(); } if (statisticsTimer != null) { statisticsTimer.Dispose(); } } m_Disposed = true; }