コード例 #1
0
 private void AddChannelUser(ChannelUserMsg userMsg)
 {
     Current.Dispatcher.Invoke(() => ChannelUsers.Add(new ChannelUser
     {
         Name         = userMsg.Name,
         AllowControl = userMsg.AllowControl,
         Id           = userMsg.Id
     }));
 }
コード例 #2
0
        private void RemoveChannelUser(ChannelUserMsg userMsg)
        {
            var connectedUser = ChannelUsers.FirstOrDefault(u => u.Id == userMsg.Id);

            Current.Dispatcher.Invoke(() => ChannelUsers.Remove(connectedUser));
        }
コード例 #3
0
 public static Task SendUserConnected(this IHubContext <HostHub> hubContext, string hostConnectionId,
                                      ChannelUserMsg channelUserMsg)
 {
     return(hubContext.Clients.Client(hostConnectionId).SendAsync("UserConnected", channelUserMsg));
 }