public override void Connect() { this.disposed = false; this.timer = new HighAccuracyTimer() { Interval = INTERVAL, Resolution = 0, Mode = TimerMode.Periodic, }; this.timer.Elapsed += TimerElapsed; OnConnected(); }
void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { this.timer?.Dispose(); } this.timer = null; this.disposed = true; } }