newer c# lang

This commit is contained in:
BlubbFish 2021-04-10 01:02:20 +02:00
parent d7f2ccd4af
commit 51bfd52095

View File

@ -123,14 +123,14 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
#region IDisposable Support #region IDisposable Support
private Boolean disposedValue = false; private Boolean disposedValue = false;
public override Boolean IsConnected => this.client != null ? this.client.IsConnected : false; public override Boolean IsConnected => this.client != null && this.client.IsConnected;
protected virtual void Dispose(Boolean disposing) { protected virtual void Dispose(Boolean disposing) {
if(!this.disposedValue) { if(!this.disposedValue) {
if(disposing) { if(disposing) {
try { try {
this.connectionWatcherRunning = false; this.connectionWatcherRunning = false;
while(this.connectionWatcher.IsAlive) { while(this.connectionWatcher != null && this.connectionWatcher.IsAlive) {
Thread.Sleep(10); Thread.Sleep(10);
} }
this.connectionWatcher = null; this.connectionWatcher = null;