private void client_GetTokenCompleted(object sender, GetTokenCompletedEventArgs e) { try { if (e.Result != null) { foreach (TokenKeyCollection resultKey in e.Result) { ConfigurationSettings.TokenKey = resultKey.TokenKeyString; ConfigurationSettings.TokenKeySecret = resultKey.TokenKeySecretString; ConfigurationSettings.UserName = txtUserName.Text; ConfigurationSettings.Password = txtPassword.Password; } VerifyCredentialsLogin("xml"); } else { mMessageChildWindow = new MessageChildWindow((int)Globals.Message.VerifyError); mMessageChildWindow.Show(); } } catch (Exception) { busyIndicator.IsBusy = false; btLogin.IsEnabled = true; } }
private void tlSecurityClient_GetTokenCompleted(object sender, GetTokenCompletedEventArgs e) { try { if (e.Result.ResponseState == TimelogSecurityService.ExecutionStatus.Success) { if (!String.IsNullOrEmpty(e.Result.Return[0].ToString())) { TimelogSession tlSession = TimelogSession.Instance; tlSession.SecurityToken = e.Result.Return[0]; } tlViewModel.ChangeState(ETimelogState.Successfull, ETimelogOperation.Login, String.Empty); } else if (e.Error != null) { tlViewModel.ChangeState(ETimelogState.Error, ETimelogOperation.Login, e.Error.Message); } else { tlViewModel.ChangeState(ETimelogState.Error, ETimelogOperation.Login, String.Empty); } } catch (Exception ex) { if (e.Error != null) { tlViewModel.ChangeState(ETimelogState.Error, ETimelogOperation.Login, e.Error.Message); } else { tlViewModel.ChangeState(ETimelogState.Error, ETimelogOperation.Login, ex.Message); } } }
void ClientGetTokenCompleted(object sender, GetTokenCompletedEventArgs e) { if (e.Result.GetTokenResult.ErrorCode == 0) { Token = e.Result.GetTokenResult.Return[0]; } }
void _secClient_GetTokenCompleted(object sender, GetTokenCompletedEventArgs e) { try { tlpSecurity.SecurityToken _token = e.Result.GetTokenResult.Return.FirstOrDefault(); if (_token == null) { throw new Exception("Unable to connect to the service: " + e.Result.GetTokenResult.Messages[0].Message); } tlp.SecurityToken _prjToken = new tlp.SecurityToken() { Expires = _token.Expires, Hash = _token.Hash, Initials = _token.Initials }; App.IdentityViewModel.ProjectToken = _prjToken; // Fetch all task from the server tlp.ProjectManagementServiceClient _prjClient = new tlp.ProjectManagementServiceClient(); _prjClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(_prjClient.Endpoint.Address.ToString().Replace("app.timelog.dk/local", App.IdentityViewModel.HostAddr)); _prjClient.GetTasksAllocatedToEmployeeCompleted += new EventHandler<tlp.GetTasksAllocatedToEmployeeCompletedEventArgs>(_prjClient_GetTasksAllocatedToEmployeeCompleted); _prjClient.GetTasksAllocatedToEmployeeAsync(new tlp.GetTasksAllocatedToEmployeeRequest(App.IdentityViewModel.User, _prjToken)); } catch (Exception ex) { ConnectionStatus = "Unable to connect: " + Environment.NewLine + ex.Message; } }
void _secClient_GetTokenCompleted(object sender, GetTokenCompletedEventArgs e) { tlpSecurity.SecurityToken token = e.Result.GetTokenResult.Return.FirstOrDefault(); if (token == null) { throw new Exception("Unable to connect to the service: " + e.Result.GetTokenResult.Messages[0].Message); } var prjToken = new SecurityToken { Expires = token.Expires, Hash = token.Hash, Initials = token.Initials }; App.IdentityViewModel.ProjectToken = prjToken; }