private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog fDialog = new OpenFileDialog(); fDialog.Title = "Open AIS Definition File"; fDialog.Filter = Constants.XMLAISDefnFileFilter; if ((fDialog.ShowDialog() == DialogResult.OK) && (fDialog.CheckFileExists == true)) { aisDefnCol = AISDefnCollection.LoadFromFile(fDialog.FileName); saveToolStripMenuItem.Enabled = true; this.Text = "AIS Explorer - " + fDialog.FileName; anyChanges = false; } }
public AISExplorerForm(string fileName) { InitializeComponent(); aisDefnCol = AISDefnCollection.LoadFromFile(fileName); dgvDefns.DataSource = aisDefnCol.AisDefns; if (aisDefnCol.FileName != "") { this.Text = "AIS Explorer - " + aisDefnCol.FileName; } saveToolStripMenuItem.Enabled = (aisDefnCol.FileName != ""); comboTypes.Items.AddRange(AISField.AllFieldTypes()); anyChanges = false; }