/// <summary> /// Настройка сервера закачек /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Setting(object sender, EventArgs e) { FormSetting form = new FormSetting(false); if (form.ShowDialog(this) == DialogResult.OK) { } RowStateChanged(); }
/// <summary> /// Событие при загрузки формы /// </summary> private void MainForm_Load(object sender, EventArgs e) { FormSetting form = new FormSetting(true); if (form.ShowDialog(this) == DialogResult.OK) { block(); DateTime dt=DateTime.Now; while (true) { if (!flagConnect) { cool(); break; } var sp = DateTime.Now- dt; if (sp.Minutes == Properties.Settings.Default.timeWait) { MessageBox.Show(this, "Сервер не доступен, приложение будет закрыто", "Уведомление", MessageBoxButtons.OK, MessageBoxIcon.Question); Close(); break; } } } else { Close(); } }