Example #1
0
        private void readConfigToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Title            = "open header config file";
            dialog.ShowHelp         = true;
            dialog.Filter           = "Header Config Files|*.hdconfig";
            dialog.FilterIndex      = 1;
            dialog.RestoreDirectory = false;
            dialog.InitialDirectory = CurrentPath;
            dialog.Multiselect      = false;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string filename = dialog.FileName;
                try
                {
                    XmlHeader.ReadFileToFillDictionary(filename);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                    return;
                }

                TableProperties = XmlHeader.DictToDataTable();
                RawExcelHeader.SetProperties(TableProperties);
            }
            else
            {
                return;
            }
            DgvExcelHenderConfig.DataSource = TableProperties;
            DgvExcelHenderConfig.AutoResizeColumns();
        }
Example #2
0
 public Form2()
 {
     CurrentPath = Application.StartupPath;
     InitializeComponent();
     TableProperties = RawExcelHeader.GetProperties();
     XmlHeader.UpdateDictByDataTable(TableProperties);
     DgvExcelHenderConfig.DataSource = TableProperties;
     DgvExcelHenderConfig.AutoResizeColumns();
 }