private void openNetCDFFileToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.FileName = Properties.Settings.Default.LastFilename; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Properties.Settings.Default.LastFilename = openFileDialog1.FileName; Properties.Settings.Default.Save(); if (File.Exists(openFileDialog1.FileName)) { StatusText("Reading NetCDF file, please wait..."); this.Cursor = Cursors.WaitCursor; Application.DoEvents(); myFile = new NcFile(openFileDialog1.FileName); ncFileExplorer1.NcFile = myFile; StatusText("Ready"); this.Cursor = Cursors.Arrow; gbEnvironmentalDatabase.Enabled = true; CheckEnvironmentalDatabaseSettings(); PopulateVariableDropdowns(); } else { ErrorText("File not found"); gbEnvironmentalDatabase.Enabled = false; gbNetCDFVariables.Enabled = false; } } }
private void textBox1_TextChanged(object sender, EventArgs e) { if (File.Exists(textBox1.Text)) { StatusText("Reading file..."); myFile = new NcFile(textBox1.Text); ncFileExplorer1.NcFile = myFile; StatusText("Ready"); } else ErrorText("File not found"); }