Example #1
0
        private void openN0183DefinitionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog fDialog = new OpenFileDialog();
                fDialog.Title  = "Open PGN Definition File";
                fDialog.Filter = Constants.XMLN0183DefnFileFilter;
                if ((fDialog.ShowDialog() == DialogResult.OK) && (fDialog.CheckFileExists == true))
                {
                    N0183DefnCol = N0183DefnCollection.LoadFromFile(fDialog.FileName);

                    saveDefinitionsToolStripMenuItem.Enabled = true;
                    this.Text = originalFormText + " - " + fDialog.FileName;
                }
            }
            catch
            {
                N0183DefnCol = null;
                throw;
            }
            finally
            {
                DefnsChanged();
            }
        }
Example #2
0
        public N0183ExplorerForm(string fileName)
        {
            InitializeComponent();
            N0183DefnCol = N0183DefnCollection.LoadFromFile(fileName); // Creates our own copy.
            comboTypes.Items.AddRange(N0183Field.AllFieldTypes());

            originalFormText = this.Text;

            if (fileName != "")
            {
                this.Text = originalFormText + " - " + fileName;
            }

            saveDefinitionsToolStripMenuItem.Enabled = (fileName != "");

            AnyChanges = false;
        }