private void _raiseUserChanged(WSClientInfo info) { if (this.OnWSUserStateChanged != null) { this.OnWSUserStateChanged(info); } }
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; } }
public void RegisterUser(WSClientInfo info) { lock (_lockObject) { //info.CiscoExtention = HpsmCisco.Instance.FindCiscoUser(info.UserName); _users.Add(info); _raiseUserChanged(info); } }
public void SetCanReceiveMessage(string userName, string win, bool can) { lock (_lockObject) { WSClientInfo user = FindUser(userName, win); if (user != null) { user.CanReceiveMessage = can; } } }
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); } }
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; } } } }