示例#1
0
 public void Update(T key, string nickName)
 {
     lock (_connections)
     {
         if (_connections.ContainsKey(key))
         {
             _connections[key] = new UserConnectionInfo {
                 ConnectionId = GetConnections(key).ConnectionId, NickName = nickName
             };
         }
     }
 }
示例#2
0
        public void Add(T key, UserConnectionInfo userInfo)
        {
            lock (_connections)
            {
                if (!_connections.ContainsKey(key))
                {
                    _connections.Add(key, userInfo);
                }
            }

            userAdded?.Invoke(this, new AddMyUserEventArgs {
                Id = key as string
            });
        }