Example #1
0
 public void Dispose()
 {
     this.RealtimeOrderBookSubscription.RealtimeMatch -= OnMatch;
     if (robsCreatedLocally)
     {
         RealtimeOrderBookSubscription.Dispose();
     }
 }
Example #2
0
        public RealtimePriceClient(string ProductString, RealtimeOrderBookSubscription realtimeOrderBookSubscription,
                                   CBAuthenticationContainer auth = null)
        {
            this.ProductString = ProductString;

            this.RealtimeOrderBookSubscription = realtimeOrderBookSubscription;
            this.RealtimeOrderBookSubscription.RealtimeMatch += OnMatch;
            // should already be subscribed since robs is passed in
        }
        public void Dispose()
        {
            this.RealtimeOrderBookSubscription.RealtimeOpen      -= OnOpen;
            this.RealtimeOrderBookSubscription.RealtimeDone      -= OnDone;
            this.RealtimeOrderBookSubscription.RealtimeMatch     -= OnMatch;
            this.RealtimeOrderBookSubscription.RealtimeChange    -= OnChange;
            this.RealtimeOrderBookSubscription.RealtimeReceived  -= OnReceived;
            this.RealtimeOrderBookSubscription.RealtimeLastMatch -= OnLastMatch;
            this.RealtimeOrderBookSubscription.Heartbeat         -= OnHeartbeat;
            this.RealtimeOrderBookSubscription.ConnectionClosed  -= OnConnectionClosed;

            if (robsCreatedLocally)
            {
                RealtimeOrderBookSubscription.Dispose();
            }
        }
        public RealtimeOrderBookClient(string ProductString, RealtimeOrderBookSubscription realtimeOrderBookSubscription,
                                       CBAuthenticationContainer auth = null)
        {
            this.ProductString          = ProductString;
            this.productOrderBookClient = new ProductOrderBookClient(auth);

            Sells = new ConcurrentObservableSortedDictionary <decimal, ObservableLinkedList <BidAskOrder> >(isMultithreaded: true, comparer: new DescendingComparer <decimal>());
            Buys  = new ConcurrentObservableSortedDictionary <decimal, ObservableLinkedList <BidAskOrder> >(isMultithreaded: true, comparer: new DescendingComparer <decimal>());

            this.RealtimeOrderBookSubscription = realtimeOrderBookSubscription;
            this.RealtimeOrderBookSubscription.RealtimeOpen   += OnOpen;
            this.RealtimeOrderBookSubscription.RealtimeDone   += OnDone;
            this.RealtimeOrderBookSubscription.RealtimeMatch  += OnMatch;
            this.RealtimeOrderBookSubscription.RealtimeChange += OnChange;

            // not really used for anything except for their sequence number
            this.RealtimeOrderBookSubscription.RealtimeReceived  += OnReceived;
            this.RealtimeOrderBookSubscription.RealtimeLastMatch += OnLastMatch;
            this.RealtimeOrderBookSubscription.Heartbeat         += OnHeartbeat;

            this.RealtimeOrderBookSubscription.ConnectionClosed += OnConnectionClosed;
        }
 public void Dispose()
 {
     RealtimeOrderBookSubscription.UnSubscribe();
 }