Ejemplo n.º 1
0
        public void removeCommandListener(CommandReceived <T> callback)
        {
            List <T> subscriptionHolder = GetSubscriptionHolder();

            for (int i = subscriptionHolder.Count - 1; i >= 0; i--)
            {
                T messagingSubscription = subscriptionHolder[i];

                if (messagingSubscription.Callback.UsersCallback.Equals(callback))
                {
                    subscriptionHolder.RemoveAt(i);

                    if (IsConnected())
                    {
                        rtClient.Unsubscribe(messagingSubscription.Id);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void RemoveEventListener(TestSubscription testSubscription)
        {
            var subscriptionsToRemove = new List <string>();

            foreach (RTSubscription existingSubscription in subscriptions.Values)
            {
                if (testSubscription(existingSubscription))
                {
                    rt.Unsubscribe(existingSubscription.Id);
                    subscriptionsToRemove.Add(existingSubscription.Id);
                }
            }

            foreach (var id in subscriptionsToRemove)
          #if NET_35
            { subscriptions.Remove(id); }
          #else
            { subscriptions.TryRemove(id, out _); }
          #endif
        }
Ejemplo n.º 3
0
 public void Disconnect()
 {
     rtClient.Unsubscribe(connectSubscription.Id);
     connected = false;
 }
Ejemplo n.º 4
0
        public void Unsubscribe(string subscriptionId)
        {
            Thread thread = new Thread(() => rtClient.Unsubscribe(subscriptionId));

            thread.Start();
        }