Пример #1
0
        public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled)
        {
            UpdateSfIdFromQuerystring();
            string       userName = UserName();
            ChatUserInfo user     = _userList.SingleOrDefault(u => u.StoreFrontConfigurationId == _currentStoreFrontConfigurationId && u.Name.ToLower() == userName.ToLower());

            if (user.IsSet)
            {
                _userList.Remove(user);
                CurrentStoreFrontGroup.UserLeft(userName);
                CurrentStoreFrontGroup.UpdatedUserList(CurrentStoreFrontUserList());
            }
            return(base.OnDisconnected(stopCalled));
        }
Пример #2
0
        protected void Join()
        {
            string userName = UserName();

            Groups.Add(Context.ConnectionId, userName);
            Groups.Add(Context.ConnectionId, StoreFrontGroupName(_currentStoreFrontConfigurationId));
            ChatUserInfo user = _userList.SingleOrDefault(u => u.StoreFrontConfigurationId == _currentStoreFrontConfigurationId && u.Name.ToLower() == userName.ToLower());

            if (!user.IsSet)
            {
                user = new ChatUserInfo()
                {
                    ConnectionId = this.Context.ConnectionId, Name = userName, StoreFrontConfigurationId = _currentStoreFrontConfigurationId, IsSet = true
                };
                _userList.Add(user);
                CurrentStoreFrontGroup.UpdatedUserList(CurrentStoreFrontUserList());
            }

            CurrentStoreFrontGroup.UserJoined(userName);
            Clients.Caller.UpdatedUserList(CurrentStoreFrontUserList());
        }
Пример #3
0
        public virtual void SendToStoreAllAsAdmin(int sfId, string message)
        {
            string user = "******";

            CurrentStoreFrontGroup.MessageIncoming(message, user, false, false);
        }