예제 #1
0
 public virtual void Dispose()
 {
     ConnectionAdapter?.Dispose();
     CurrentPrices = null;
     Products      = null;
     // Suppress finalization.
     GC.SuppressFinalize(this);
 }
예제 #2
0
 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>();
 }
예제 #3
0
        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);
        }