Ejemplo n.º 1
0
        // "Compare To..." button clicked.
        private void btnCompare_Click(object sender, EventArgs e)
        {
            RCH2Container rch2compare;

            // Get another installer from them.
            if (fdOpenInstaller.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            // Load the file.
            rch2compare = FurcadiaInstaller.GetFileContainer(fdOpenInstaller.FileName);
            if (rch2compare == null)
            {
                MessageBox.Show("Cannot load comparison file - make sure this is a Furcadia installer.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            // Display comparison dialog.
            RCH2Compare cmp = new RCH2Compare(ref rch2, ref rch2compare);

            if (cmp.Identical)
            {
                MessageBox.Show("The two files have identical install packages.", "Identical Packages", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            CompareForm cf = new CompareForm(ref cmp);

            cf.FileName1 = txtInstallerName.Text;
            cf.FileName2 = fdOpenInstaller.SafeFileName;
            cf.ShowDialog();
        }
Ejemplo n.º 2
0
        /*** Constructor ***/
        public CompareForm(ref RCH2Compare compareInstance)
        {
            CompareInstance = compareInstance;

            InitializeComponent();

            // Generate two DGVs for the areas.
            dgvFile1 = CreateDataGridView("dgvFile1");
            dgvFile2 = CreateDataGridView("dgvFile2");
            splitContainer.Panel1.Controls.Add(dgvFile1);
            splitContainer.Panel2.Controls.Add(dgvFile2);

            // Populate DGVs.
            PopulateLists();
        }