private void btnReport_Click(object sender, EventArgs e)
        {
            if (lstDbs.CheckedItems.Count == 0)
            {
                MessageBox.Show("Please check a database to use as a baseline", "Selection Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            this.rawReportData.ResetComparisonValues();

            List <ObjectScriptHashData> hashes = new List <ObjectScriptHashData>();

            ObjectScriptHashData baseline = (ObjectScriptHashData)lstDbs.CheckedItems[0].Tag;

            foreach (ObjectScriptHashData data in rawReportData.DatabaseData)
            {
                if (!data.Equals(baseline))
                {
                    hashes.Add(data);
                }
            }

            HashCollector coll = new HashCollector();

            rawReportData = coll.ProcessHashDifferences(baseline, hashes);
            string tempFile = System.IO.Path.GetTempFileName();

            tempFile = System.IO.Path.GetFileNameWithoutExtension(tempFile) + ".html";
            coll.GenerateReport(tempFile, SqlSync.SqlBuild.Status.ReportType.Summary, this.rawReportData);
            this.rawReportData.DatabaseData.Add(baseline);

            System.Diagnostics.Process prc = new System.Diagnostics.Process();
            prc.StartInfo.FileName = tempFile;
            prc.Start();
        }
Exemple #2
0
        protected override void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            KeyValuePair <ReportType, string> args = (KeyValuePair <ReportType, string>)e.Argument;

            this.collector     = new HashCollector(this.multiDbData);
            this.rawReportData = collector.GetObjectHashes(ref this.bgWorker, args.Value, args.Key, this.scriptThreaded);
            e.Result           = rawReportData;

            bgWorker.ReportProgress(0, "Generating report output");
            base.bgWorker.DoWork -= new System.ComponentModel.DoWorkEventHandler(base.bgWorker_DoWork);
        }