protected override void CleanupManagedResources() { if (Timer != null) { Timer.Dispose(); } base.CleanupManagedResources(); }
// Add more work to the developer protected void AddWork(Object stateInfo) { SubmitTask(); // developer ended, kill timer if (s_end) { TaskTimer.Dispose(); TaskExecutor = null; } }
protected void StopTimer() { try { if (m_Timer != null) { m_Timer.Stop(); m_Timer.Dispose(); m_Timer = null; } } catch (Exception ex) { ex.LogError(); } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { TaskTimer?.Dispose(); TaskTimer = null; StatusTimer?.Dispose(); StatusTimer = null; } disposedValue = true; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> protected virtual void Dispose(bool isDisposing) { if (!isDisposing) { return; } if (_pollingTimer != null) { _pollingTimer.Dispose(); } if (_cancellationTokenSource != null) { _cancellationTokenSource.Dispose(); } }