private void AddChannelUser(ChannelUserMsg userMsg) { Current.Dispatcher.Invoke(() => ChannelUsers.Add(new ChannelUser { Name = userMsg.Name, AllowControl = userMsg.AllowControl, Id = userMsg.Id })); }
private void RemoveChannelUser(ChannelUserMsg userMsg) { var connectedUser = ChannelUsers.FirstOrDefault(u => u.Id == userMsg.Id); Current.Dispatcher.Invoke(() => ChannelUsers.Remove(connectedUser)); }
public static Task SendUserConnected(this IHubContext <HostHub> hubContext, string hostConnectionId, ChannelUserMsg channelUserMsg) { return(hubContext.Clients.Client(hostConnectionId).SendAsync("UserConnected", channelUserMsg)); }