public void Close() { lock (this.ThisLock) { this.isOpen = false; } this.maintainerTimer.Cancel(); SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(this.SystemEvents_PowerModeChanged); MaintainerClosedHandler maintainerClosed = this.MaintainerClosed; if (maintainerClosed != null) { maintainerClosed(); } }
public void Close() { lock (ThisLock) { isOpen = false; } maintainerTimer.Cancel(); // No reconnect while closed SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); MaintainerClosedHandler handler = MaintainerClosed; if (handler != null) { handler(); } }