示例#1
0
        public void AddContact(string name, string id, string connectionId)
        {
            lock (usersOnlineLock)
            {
                if (_updatingUsersOnlineList)
                {
                    return;
                }
                _updatingUsersOnlineList = true;

                _usersOnline.AddOrUpdate(name, id, (key, value) =>
                {
                    value = id;
                    return(value);
                });

                _clients.AllExcept(connectionId).addContact(new { Id = id, Name = name });

                _updatingUsersOnlineList = false;
            }
        }
示例#2
0
 public T AllExcept(params string[] excludeConnectionIds)
 {
     return(TypedClientBuilder <T> .Build(_dynamicContext.AllExcept(excludeConnectionIds)));
 }
示例#3
0
 public void NotifyAllExceptCallerOfNew(string connectionId, TEntity entity)
 {
     _clients.AllExcept(connectionId).entityAdded(entity);
 }