private void openPGNDefinitionFileToolStripMenuItem_Click(object sender, EventArgs e) { try { OpenFileDialog fDialog = new OpenFileDialog(); fDialog.Title = "Open PGN Definition File"; fDialog.Filter = Constants.XMLPGNDefnFileFilter; // fDialog.InitialDirectory = @"C:\"; if ((fDialog.ShowDialog() == DialogResult.OK) && (fDialog.CheckFileExists == true)) { PGNDefnCol = PGNDefnCollection.LoadFromFile(fDialog.FileName); } } catch { PGNDefnCol = null; throw; } finally { PGNForm2_VisibleChanged(null, null); // force the form title to update UpdateGridDisplays(GridViewsUpdateType.RebindPGNs); } }
// Creator public PGNExplorerForm(string fileName) { InitializeComponent(); PGNDefnCol = PGNDefnCollection.LoadFromFile(fileName); // Creates our own copy FormTitleText = this.Text; if (fileName == "") { this.Text += " - <Internal>"; } else { this.Text += " - " + fileName; } // We have a combo-box thatallowsd the type (class) of a field to be changed; populate this with the list of all CAN Field Types FieldClassTypeListComboBox.Items.AddRange(N2kField.AllFieldTypes()); // We display the DisplayName field of these UpdateGridDisplays(GridViewsUpdateType.RebindPGNs); AnyChanges = false; savePGNDefinitionFileToolStripMenuItem.Enabled = (fileName != ""); }