Beispiel #1
0
 private void _raiseUserChanged(WSClientInfo info)
 {
     if (this.OnWSUserStateChanged != null)
     {
         this.OnWSUserStateChanged(info);
     }
 }
Beispiel #2
0
        public void ProcessUser(WSClientStatus command, string userName, string win)
        {
            lock (_lockObject)
            {
                foreach (var user in _users)
                {
                    if (user.UserName == userName && user.WIN == win)
                    {
                        user.Pulse++;
                        user.Command = command;

                        _raiseUserChanged(user);
                        return;
                    }
                }
                if (command == WSClientStatus.tapi)
                {
                    command = WSClientStatus.tapi_reg;
                }
                WSClientInfo info = new WSClientInfo()
                {
                    UserName = userName, WIN = win, Command = command, Pulse = 1
                };
                _users.Add(info);
                _raiseUserChanged(info);
                return;
            }
        }
Beispiel #3
0
 public void RegisterUser(WSClientInfo info)
 {
     lock (_lockObject)
     {
         //info.CiscoExtention = HpsmCisco.Instance.FindCiscoUser(info.UserName);
         _users.Add(info);
         _raiseUserChanged(info);
     }
 }
Beispiel #4
0
 public void SetCanReceiveMessage(string userName, string win, bool can)
 {
     lock (_lockObject)
     {
         WSClientInfo user = FindUser(userName, win);
         if (user != null)
         {
             user.CanReceiveMessage = can;
         }
     }
 }
Beispiel #5
0
 public WSClientInfo RegisterUser(string userName, string win)
 {
     lock (_lockObject)
     {
         WSClientInfo info = new WSClientInfo()
         {
             UserName = userName, WIN = win, Command = WSClientStatus.reg, Pulse = 1
         };
         //info.CiscoExtention = HpsmCisco.Instance.FindCiscoUser(userName);
         _users.Add(info);
         _raiseUserChanged(info);
         return(info);
     }
 }
Beispiel #6
0
 public void UnregisterUser(WSClientInfo info)
 {
     lock (_lockObject)
     {
         foreach (var user in _users)
         {
             if (user.UserName == info.UserName && user.WIN == info.WIN)
             {
                 info.Command = WSClientStatus.closed;
                 _users.Remove(info);
                 _raiseUserChanged(info);
                 return;
             }
         }
     }
 }