protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (EventTimer != null) { EventTimer.Stop(); EventTimer.Enabled = false; EventTimer.Elapsed -= ElapsedEventTick; EventTimer.Dispose(); EventTimer = null; } if (SongTimer != null) { SongTimer.Stop(); SongTimer.Enabled = false; SongTimer.Elapsed -= ElapsedSongTick; SongTimer.Dispose(); SongTimer = null; } } _disposed = true; }
public void Dispose() { if (EventTimer != null) { EventTimer.Enabled = false; EventTimer.Elapsed -= ElapsedEventTick; EventTimer.Dispose(); } if (SongTimer != null) { SongTimer.Enabled = false; SongTimer.Elapsed -= ElapsedSongTick; SongTimer.Dispose(); } }