/// <summary> /// Запуск клиента с сохранением введенных параметров /// </summary> private async void Accept_Click(object sender, RoutedEventArgs e) { if (IsValidIPAddress(Address) && IsValidPort(Port) && IsValidLogin(Login)) { Address = addressTextBox.Text; Port = portTextBox.Text; Login = loginTextBox.Text; ReadyClient = new ClientTCP(Address, int.Parse(Port), Login); try { await ReadyClient.ConnectAsync(); AppConfigManager.UpdateConfigParameter("ip_address", Address); AppConfigManager.UpdateConfigParameter("port", Port); AppConfigManager.UpdateConfigParameter("login", Login); DialogResult = true; } catch { MessageBox.Show("Server is not available"); } } }