/// <summary> /// Load the main form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainForm_Load(object sender, EventArgs e) { cmbAuth.SelectedIndex = 0; //load the configuration _cnf = new Converter.Configuration.Configuration(); _cnf.LoadConfig(); txtServer.Focus(); }
private void Timer1_Tick_1(object sender, EventArgs e) { if (_mainObr == null || _mainObr.IsAlive) { return; } try { Timer1.Enabled = false; _mainObr.Join(); _mainObr = null; } catch (Exception) { if (Debugger.IsAttached) { Debugger.Break(); } } _t2 = DateTime.Now; ProgressBar1.Visible = false; btnCancel.Enabled = false; btnConvertToMO.Enabled = true; grpOptions.Enabled = true; grpConnection.Enabled = true; if (_success) { TimeSpan ts = _t2 - _t1; MessageBox.Show($@"Switching to in-memory OLTP finished successfully. Elapsed time {ts:dd\.hh\:mm\:ss}", @"Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } SetLabelText(""); if (_isAborted == false) { var fileName = $"{_i.DatabaseName}{DateTime.Now:yyyy_mm_dd_HH_mm_ss}.txt"; if (File.Exists(fileName)) { File.Delete(fileName); } File.WriteAllText(fileName, _sb.ToString()); // start notepad and disply the configuration Process.Start(fileName); } else { _isAborted = false; } SetLabelText(""); _cnf.LoadConfig(); _sb = null; }
private void Window_Loaded(object sender, RoutedEventArgs e) { cmbAuth.SelectedIndex = 0; txtPassword.IsEnabled = false; txtUserName.IsEnabled = false; cmbDestination.IsEnabled = false; chkNewDatabase.IsChecked = true; //load the configuration _cnf = new Converter.Configuration.Configuration(); _cnf.LoadConfig(); txtServer.Focus(); _isLoaded = true; }