Пример #1
0
        private bool disposedValue = false; // To detect redundant calls

        protected override void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    UnregisterEvents();

                    _clock?.Close();
                }

                disposedValue = true;
            }
            base.Dispose(disposing);
        }
Пример #2
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    UnregisterEvents();
                    Stop();

                    _timer?.Close();
                    _sound?.Dispose();
                }
                disposedValue = true;
            }
        }