/// <summary> /// This does the initial load of this form /// Firstly it checks that the oracle instant client DLLs are present /// Then it loads the settings from disk /// </summary> private void MainWindow_Load(object sender, EventArgs e) { bnHelp_Click(null, null); DbHelper h = new DbHelper(); if (!h.OracleFilesPresent()) { MessageBox.Show( @"Oracle Driver files aren't all present: oci.dll, orannzsbb*.dll, oraocci*.dll, oraociicus*.dll This files must be in the same folder as the Oracle Explorer executable for the oracle connection to work. These files can be obtained from the Oracle Instant Client from the oracle website"); } // Load the settings if (settings == null) { settings = new Settings(); settings.Load(); connections = settings.Connections; foreach (Connection c in connections) { TreeNode n = new TreeNode(c.Name); n.ImageIndex = n.SelectedImageIndex = 1; n.Tag = c; n.Nodes.Add(loading); treeConnections.Nodes.Add(n); } } // initialise controls lblConn.Text = ""; txtQuery.Enabled = false; gridOutput.Enabled = false; bnExecute.Enabled = false; }
/// <summary> /// This saves to the database /// </summary> private void MainWindow_FormClosed(object sender, FormClosedEventArgs e) { if (settings != null) { settings.Connections = connections; settings.Save(); settings = null; } }