private static bool SaveCurrentChannel(ConnectedChannelInfo clientInformation) { try { if (clientInformation == null) { throw new ArgumentNullException(); } ConnectedChannelInfo client = GetClientByChannelId(clientInformation); if (client != null) { DicClients.Remove(client); } DicClients.Add(clientInformation, CallbackChannel); return(true); } catch (ArgumentNullException) { return(false); } catch (ArgumentException) { return(false); } }
public bool RemoveSubscriber(ConnectedChannelInfo subscriberInformation) { if (subscriberInformation == null) { throw new ArgumentNullException(); } return(RemoveCurrentChannel(subscriberInformation)); }
private void SubscribeToService() { if (ChannelId != null) { var clientInfo = new ConnectedChannelInfo { ChannelId = ChannelId.Value, ChannelName = "Test PC " + ChannelId.ToString() }; serviceConnectionInitialization.SubscribeToService(clientInfo); } }
public IPubSubClientCallback GetSpesificSubscriberChannel(ConnectedChannelInfo subscriberInformation) { if (subscriberInformation == null) { throw new ArgumentNullException(); } ConnectedChannelInfo client = DicClients.Keys.FirstOrDefault(x => x.ChannelId == subscriberInformation.ChannelId); if (client != null) { return(DicClients[client]); } return(null); }
public bool Unsubscribe(ConnectedChannelInfo connectedChannelInfo) { return(subscribersManagement.RemoveSubscriber(connectedChannelInfo)); }
public bool Subscribe(ConnectedChannelInfo connectedChannelInfo) { return(subscribersManagement.AddSubscriber(connectedChannelInfo)); }
public void SubscribeToService(ConnectedChannelInfo SubscriberInformation) { _serviceWrapper.Channel.Subscribe(SubscriberInformation); }
private static ConnectedChannelInfo GetClientByChannelId(ConnectedChannelInfo subscriberInformation) { return(DicClients.Keys.FirstOrDefault(x => x.ChannelId == subscriberInformation.ChannelId)); }