public virtual void Dispose() { ConnectionAdapter?.Dispose(); CurrentPrices = null; Products = null; // Suppress finalization. GC.SuppressFinalize(this); }
protected AbstractExchangePlugin() { AccountInfo = new Dictionary <string, decimal>(); CurrentPrices = new Dictionary <string, decimal>(); SubscribedPrices = new Dictionary <string, decimal>(); ConnectionAdapter = new ConnectionAdapter(); Products = new List <Product>(); Statistics = new Dictionary <string, Statistics>(); }
public virtual async Task <bool> CloseFeed() { bool isClosed = false; try { ProcessLogBroadcast?.Invoke(ApplicationName, MessageType.General, "Closing Feed Subscription."); isClosed = await ConnectionAdapter?.WebSocketCloseAsync(); } catch (Exception e) { ProcessLogBroadcast?.Invoke(ApplicationName, MessageType.Error, $"Method: CloseFeed\r\nException Stack Trace: {e.StackTrace}"); } return(isClosed); }