Esempio n. 1
0
 public void RemoveListener(Guid token)
 {
     if (_hub.IsSubscribed(token))
     {
         _hub.Unsubscribe(token);
     }
 }
        /// <inheritdoc />
        protected override Task StopServiceAsync(CancellationToken cancellationToken)
        {
            // Unsubscribe all message hub subscriptions
            foreach (var token in _messageHubSubscriptions)
            {
                _messageHub.Unsubscribe(token);
            }

            return(Task.CompletedTask);
        }
        /// <inheritdoc />
        public Task StopAsync(CancellationToken cancellationToken)
        {
            // Unsubscribe all message hub subscriptions
            foreach (var token in _messageHubSubscriptions)
            {
                _messageHub.Unsubscribe(token);
            }

            return(Task.CompletedTask);
        }
Esempio n. 4
0
        public static IDisposable SubscribeDisposable <T>(this IMessageHub messageHub, Action <T> action)
        {
            var subId = messageHub.Subscribe(action);

            return(Disposable.Create(() => messageHub.Unsubscribe(subId)));
        }
 public void Dispose()
 {
     _eventAggregator.Unsubscribe(_ticketScanAddedSubscription);
     _eventAggregator.Unsubscribe(_ticketScanUpdatedSubscription);
 }
Esempio n. 6
0
 public void Unsubscribe(int id)
 {
     messageHub.Unsubscribe(id);
 }