コード例 #1
0
        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;
        }
コード例 #2
0
        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();
            }
        }