private void _updateTimer_Elapsed(object sender, ElapsedEventArgs e) { try { if (Credentials.Check()) { _updateTimer.Stop(); var settings = new QueuekerSettings { Host = Credentials.Host, Login = Credentials.Login, Password = Credentials.Password }; _queuekerClient = QueuekerClient.Create(TransportTypes.Http, settings); var info = _queuekerClient.GetInfo().Result; Dispatcher.FromThread(_primeWindowThread)?.Invoke(() => { _AllResources.Clear(); foreach (var queue in info) { _AllResources.Add(queue); } }); _updateTimer.Start(); } } catch (Exception exception) { Console.WriteLine($"PrimeWindowVM _updateTimer_Elapsed Error: {exception.Message}"); } }
public async Task ChangeLoginAndPasswordCommand(string newLogin, string newPass) { try { if (Credentials.Check()) { var settings = new QueuekerSettings { Host = Credentials.Host, Login = Credentials.Login, Password = Credentials.Password }; _queuekerClient = QueuekerClient.Create(TransportTypes.Http, settings); await _queuekerClient.ChangeLoginAndPassword(newLogin, newPass); Credentials.Login = Credentials.NewLogin; Credentials.Password = Credentials.Password; } } catch (Exception e) { Console.WriteLine($"PrimeWindowVM ChangeLoginAndPasswordCommand Error: {e.Message}"); MessageBox.Show("Change Login And Password Error!"); } }