private void Button_Click_1(object sender, RoutedEventArgs e) { MySqlSettings mySqlSettings = new MySqlSettings(); mySqlSettings.database = MYSQLDB.Text; mySqlSettings.ip = MYSQLIP.Text; mySqlSettings.username = MYSQLUSER.Text; mySqlSettings.password = MYSQLPW.Text; settings.SaveMySQLSettings(mySqlSettings); }
private void Form1_Load(object sender, EventArgs e) { bool ifExist = File.Exists(ConfigPath); //существует ли конфиг? if (ifExist == false) //если конфиг не найден, создаем, переходим на вкладку { startButton.Enabled = false; applyDate.Enabled = false; tabControl1.SelectTab(2); //активация панели настроек postsBox.Enabled = false; submitButton.Enabled = false; } else { try { _fs = new FileStream(ConfigPath, FileMode.Open); SoapFormatter sr = new SoapFormatter(); CurrentSettings = (MySqlSettings)sr.Deserialize(_fs); addressSQL.Text = CurrentSettings.Address; baseName.Text = CurrentSettings.BaseN; loginSQL.Text = CurrentSettings.Login; passwordSQL.Text = CurrentSettings.Password; AddLogMessage("Настройки загружены"); if (CheckSql()) { startButton.Enabled = true; applyDate.Enabled = true; } else { AddLogMessage("Неверные настройки БД"); startButton.Enabled = false; applyDate.Enabled = false; } } catch { startButton.Enabled = false; applyDate.Enabled = false; AddLogMessage("Ошибка загрузки настроек: укажите новые"); } _fs.Close(); } }
public MySqlSyntax(MySqlSettings settings) { Settings = settings ?? throw new ArgumentNullException(nameof(settings)); }
public L2AccountPanelContext(DbContextOptions <L2AccountPanelContext> options, MySqlSettings settings) : base(options) { _settings = settings; }
public MySqlExecutor(IConnectionSettingsProvider connectionSettingsProvider) { settings = new MySqlSettings(connectionSettingsProvider.GetSettings()); }