private void btnLoadMSIFile_Click(object sender, EventArgs e) { Logger.EnteringMethod(); MsiReader.MsiReader msiReader = new MsiReader.MsiReader(); if (openFileDialog1.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { Logger.Write("Will load " + openFileDialog1.FileName); reader.MsiFilePath = openFileDialog1.FileName; dtGrvProperties.Rows.Clear(); dtGrvProperties.Columns.Clear(); cmbBxTables.Items.Clear(); SortedDictionary <string, Table> tables = reader.GetAllMSITables(); foreach (KeyValuePair <string, Table> pair in tables) { if (pair.Value.IsOrdered) { cmbBxTables.Items.Add(pair.Value); } } cmbBxTables.Focus(); foreach (Table item in cmbBxTables.Items) { if (item.Name == "Property") { cmbBxTables.SelectedItem = item; break; } } } }
// Constructor /// <summary> /// Create an instance of the class and open the MSI file. /// </summary> /// <param name="filename">Full path to the MSI file to open.</param> public MsiFile(string filename) { this.Path = filename; this.msiReader = new MsiReader(filename); ReadCommonProperties(); }