private void btnConfigureDatabase_Click(object sender, EventArgs e) { SqlServerConfigurationForm form = new SqlServerConfigurationForm(this.connectionSettings); if (form.ShowDialog() == DialogResult.OK) { this.connectionSettings = form.Configuration; this.setDatabaseText(); } }
public Form1() { this.InitializeComponent(); WinRegistry.GetValue("Server"); WinRegistry.GetValue("Database"); this.m_customImageFilename = WinRegistry.GetValue("BackgroundImage") as string; this.m_useCustomImage = (WinRegistry.GetValue("UseCustomBackgroundImage") as string) == "True"; if (string.IsNullOrEmpty(this.m_customImageFilename) || !File.Exists(this.m_customImageFilename)) { this.m_useCustomImage = false; } this.useCustomToolStripMenuItem.Checked = this.m_useCustomImage; this.useDefaultMapToolStripMenuItem.Checked = !this.m_useCustomImage; object obj2 = WinRegistry.GetValue("WindowWidth"); object obj3 = WinRegistry.GetValue("WindowHeight"); object obj4 = WinRegistry.GetValue("SplitterPosition"); this.connectionSettings = WinRegistry.GetValue<SqlServerConfigurationForm.SqlServerConfiguration>("Connection"); if (((obj2 is int) && (obj3 is int)) && (obj4 is int)) { int width = (int) obj2; int height = (int) obj3; int num3 = (int) obj4; if (((width >= this.MinimumSize.Width) && (height >= this.MinimumSize.Height)) && ((num3 > 20) && (num3 < height))) { base.Size = new Size(width, height); this.splitContainer1.SplitterDistance = num3; } } if ((WinRegistry.GetValue("Maximized") as string) == "True") { base.WindowState = FormWindowState.Maximized; } this.tabQueries.TabPages.Clear(); this.createNewTab("Untitled", "", ""); string str = WinRegistry.GetValue("RecentFiles") as string; if (!string.IsNullOrEmpty(str)) { this.recentFiles.AddRange(str.Split(new char[] { '|' })); } this.populateRecentFileList(); if (this.connectionSettings == null) { this.btnConfigureDatabase_Click(null, null); } else { this.setDatabaseText(); } }