private void EVSdkWrapper_EventError(ManagedEVSdk.Structs.EVErrorCli err) { log.Info("EventError"); if (EVSdkManager.ACTION_CHANGEDISPLAYNAME == err.action) { UpdateUserDisplayName(); } log.Info("EventError end"); }
private void EVSdkWrapper_EventError(ManagedEVSdk.Structs.EVErrorCli err) { log.Info("EventError"); if (EVSdkManager.ACTION_UPLOADUSERIMAGE == err.action) { Application.Current.Dispatcher.InvokeAsync(() => { ProgressDialog.Instance.Hide(); MessageBoxTip tip = new MessageBoxTip(_ownerWindow); tip.SetTitleAndMsg(LanguageUtil.Instance.GetValueByKey("PROMPT"), LanguageUtil.Instance.GetValueByKey("UPLOAD_PIC_FAILURE"), LanguageUtil.Instance.GetValueByKey("CONFIRM")); tip.ShowDialog(); }); } log.Info("EventError end"); }
private void EVSdkWrapper_EventError(ManagedEVSdk.Structs.EVErrorCli err) { log.InfoFormat("EventError, type:{0}, code:{1}, msg:{2}, ation:{3}", err.type, err.code, err.msg, err.action); if ( (LoginStatus.NotLogin == LoginManager.Instance.CurrentLoginStatus || LoginStatus.LoginFailed == LoginManager.Instance.CurrentLoginStatus) && EVSdkManager.ACTION_ONCALLEND != err.action ) { log.InfoFormat("Do not show the error message for the login status is {0}. EventError end", LoginManager.Instance.CurrentLoginStatus); return; } if (EVSdkManager.ACTION_UPLOADUSERIMAGE == err.action) { log.Info("Do not handle error message whose action is uploadUserImage. EventError end"); return; } if (LoginStatus.LoggedIn == LoginManager.Instance.CurrentLoginStatus || LoginStatus.AnonymousLoggedIn == LoginManager.Instance.CurrentLoginStatus) { if (ManagedEVSdk.ErrorInfo.EV_ERROR_TYPE_CLI.EV_ERROR_TYPE_SDK == err.type) { log.InfoFormat("Do not handle sdk error, since the login status is:{0}. EventError end", LoginManager.Instance.CurrentLoginStatus); return; } if (EVSdkManager.ACTION_LOGIN == err.action || EVSdkManager.ACTION_LOGINWITHLOCATION == err.action) { log.InfoFormat("Do not handle message:{0}, since the login status is:{1}. EventError end", err.action, LoginManager.Instance.CurrentLoginStatus); return; } } LoginStatus loginStatus = LoginManager.Instance.CurrentLoginStatus; if (LoginStatus.LoggingIn == LoginManager.Instance.CurrentLoginStatus || LoginStatus.AnonymousLoggingIn == LoginManager.Instance.CurrentLoginStatus) { log.InfoFormat("Current login status:{0}. Login failed.", LoginManager.Instance.CurrentLoginStatus); LoginManager.Instance.OnLoggingInFailed(LoginStatus.LoggingIn == LoginManager.Instance.CurrentLoginStatus); } string errPrompt = null; switch (err.type) { case ManagedEVSdk.ErrorInfo.EV_ERROR_TYPE_CLI.EV_ERROR_TYPE_SDK: if (_sdkSelfErrorInfo.ContainsKey(err.code)) { errPrompt = LanguageUtil.Instance.GetValueByKey(_sdkSelfErrorInfo[err.code]); } break; case ManagedEVSdk.ErrorInfo.EV_ERROR_TYPE_CLI.EV_ERROR_TYPE_LOCATE: if (_locationErrorInfo.ContainsKey(err.code)) { errPrompt = LanguageUtil.Instance.GetValueByKey(_locationErrorInfo[err.code]); } else { if (10009 == err.code) { if (LoginStatus.AnonymousLoggingIn == loginStatus) { errPrompt = LanguageUtil.Instance.GetValueByKey("INVALID_MEETING_ID"); } else if (LoginStatus.LoggingIn == loginStatus) { errPrompt = LanguageUtil.Instance.GetValueByKey("INVALID_USER"); } else { errPrompt = string.Format(LanguageUtil.Instance.GetValueByKey("LOCATION_FAILED_LOG_IN"), err.code); } } else { errPrompt = string.Format(LanguageUtil.Instance.GetValueByKey("LOCATION_FAILED_LOG_IN"), err.code); } } break; case ManagedEVSdk.ErrorInfo.EV_ERROR_TYPE_CLI.EV_ERROR_TYPE_CALL: if (_callErrorInfo.ContainsKey(err.code)) { errPrompt = LanguageUtil.Instance.GetValueByKey(_callErrorInfo[err.code]); if (EV_CALL_BYE_MRU_NORMAL == err.code || EV_CALL_BYE_MRU_OPERATOR_DISCONNECT == err.code || EV_CALL_BYE_EP_NO_PACKET_RECEIVED == err.code || EV_CALL_BYE_MRU_NO_PACKET_RECEIVED == err.code) { if (!CallController.Instance.IsPreviousP2pCall) { errPrompt = CallController.Instance.ConferenceNumber + "\n" + errPrompt; } } } else { if (err.code == (int)ManagedEVSdk.ErrorInfo.EV_CALL_ERROR_CLI.EV_CALL_INVALID_PASSWORD) { log.InfoFormat("Ignore the error code:{0}", err.code); return; } errPrompt = "Received unknown call error, code:" + err.code; } break; case ManagedEVSdk.ErrorInfo.EV_ERROR_TYPE_CLI.EV_ERROR_TYPE_SERVER: if (_serverErrorInfo.ContainsKey(err.code)) { errPrompt = LanguageUtil.Instance.GetValueByKey(_serverErrorInfo[err.code]); if (SERVER_ERROR_LOGIN_FAILED_MORE_THAN_5_TIMES == err.code && null != err.args && err.args.Length > 0) { errPrompt = string.Format(errPrompt, err.args[0]); } } else { errPrompt = "Received unknown server error, code:" + err.code; } break; default: errPrompt = string.Format("SDK error, type:{0}, code:{1}, msg:{2}", err.type, err.code, err.msg); break; } if (!string.IsNullOrEmpty(errPrompt)) { Application.Current.Dispatcher.InvokeAsync(() => { MainWindow mainWindow = Application.Current.MainWindow as MainWindow; if (null == mainWindow) { log.Info("Can not show error message for main window is null"); return; } mainWindow.ShowPromptTip(errPrompt, string.Format("SDK error, type:{0}, code:{1}", err.type, err.code)); }); } else { log.Info("Can not show error prompt for the prompt string is empty."); } log.Info("EventError end"); }