/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> /// <filterpriority>2</filterpriority> public void Dispose() { _factory?.DisposeSafely(); if (_dataQueueHandlerBrokerage != null) { if (_dataQueueHandlerBrokerage.IsConnected) { _dataQueueHandlerBrokerage.Disconnect(); } _dataQueueHandlerBrokerage.DisposeSafely(); } else { var dataQueueHandler = Composer.Instance.GetPart <IDataQueueHandler>(); if (dataQueueHandler != null) { Log.Trace($"BrokerageSetupHandler.Setup(): Found data queue handler to dispose: {dataQueueHandler.GetType()}"); dataQueueHandler.DisposeSafely(); } else { Log.Trace("BrokerageSetupHandler.Setup(): did not find any data queue handler to dispose"); } } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> /// <filterpriority>2</filterpriority> public void Dispose() { _factory?.DisposeSafely(); if (_dataQueueHandlerBrokerage != null) { if (_dataQueueHandlerBrokerage.IsConnected) { _dataQueueHandlerBrokerage.Disconnect(); } _dataQueueHandlerBrokerage.DisposeSafely(); } }