public void UpdateLoginToken(bool logoutWhenFailed = false) { if (LoginStatus.LoggedIn != CurrentLoginStatus && LoginStatus.AnonymousLoggedIn != CurrentLoginStatus) { log.Info("Can't update login token for not login."); return; } log.Info("Update login token."); EVUserInfoCli userInfo = new EVUserInfoCli(); EVSdkManager.Instance.GetUserInfo(ref userInfo); if (null == userInfo) { log.Info("Failed to update login token"); if ( logoutWhenFailed && CallStatus.ConfIncoming != CallController.Instance.CurrentCallStatus && CallStatus.P2pIncoming != CallController.Instance.CurrentCallStatus && CallStatus.P2pOutgoing != CallController.Instance.CurrentCallStatus && CallStatus.Connected != CallController.Instance.CurrentCallStatus ) { CurrentLoginStatus = LoginStatus.NotLogin; log.Info("Failed to update token and logout."); } return; } LoginToken = userInfo.token; log.InfoFormat("Updated token value:{0}", LoginToken); DisplayName = userInfo.displayName; }
private void UpdateUserDisplayName() { EVUserInfoCli userInfo = new EVUserInfoCli(); EVSdkManager.Instance.GetUserInfo(ref userInfo); if (null == userInfo) { log.Info("Failed to get user info. Do not update display name."); return; } _viewModel.UserDisplayName = userInfo.displayName; LoginManager.Instance.DisplayName = userInfo.displayName; }
public void RefreshData() { EVUserInfoCli userInfo = new EVUserInfoCli(); EVSdkManager.Instance.GetUserInfo(ref userInfo); if (null == userInfo) { log.Info("Failed to get user info."); return; } UserDisplayName = userInfo.displayName; Cellphone = userInfo.cellphone; Telephone = userInfo.telephone; Email = userInfo.email; Department = userInfo.dept; Organization = userInfo.org; }
private void EVSdkWrapper_EventLoginSucceed(EVUserInfoCli userInfo) { WorkerThreadManager.Instance.EVSdkWorkDispatcher.InvokeAsync(() => { EventLoginSucceed?.Invoke(userInfo); }); }