Esempio n. 1
0
 static void Main()
 {
     try
     {
         Application.Run(new formResults());
     }
     catch (Exception ex)
     {
         Exception ex2 = new Exception("Unhandled Exception detected by Main Thread", ex);
         formException fE = new formException();
         fE.setExceptionData(ex2);
         fE.ShowDialog();
         return;
     }
 }
Esempio n. 2
0
        private void menuFile_Open_Click(object sender, System.EventArgs e)
        {
            formSelectFiles fsf = new formSelectFiles();
            if (fsf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                source1 = new Source(fsf.File1);
                source2 = new Source(fsf.File2);
                combined = new SortedList();

                try
                {
                    source1.ReadData();
                    source2.ReadData();
                }
                catch (Exception ex)
                {
                    formException fE = new formException();
                    fE.setExceptionData(ex);
                    fE.ShowDialog(this);
                    source1 = null;
                    source2 = null;
                    return;
                }

                {	// create the combined list
                    CombinedModule cm;
                    // copy over all modules from server1
                    foreach(Module m in source1.Modules.Values)
                    {
                        cm = new CombinedModule();
                        cm.m1 = m;
                        combined.Add(m.Name, cm);
                    }

                    // copy over server2 data and add new modules
                    foreach(Module m in source2.Modules.Values)
                    {
                        if (combined[m.Name] == null)
                        {
                            cm = new CombinedModule();
                            combined.Add(m.Name, cm);
                        }
                        else
                        {
                            cm = (CombinedModule)combined[m.Name];
                        }
                        cm.m2 = m;
                        combined[m.Name] = cm;
                    }
                }

                // draw the lists out
                fillinList(chkEquals.Checked,chkMissing.Checked,chkConflicts.Checked);

                groupServer1.Text = source1.ServerName + " - " + source1.File.Substring(source1.File.LastIndexOf("\\")+1);
                groupServer2.Text = source2.ServerName + " - " + source2.File.Substring(source2.File.LastIndexOf("\\")+1);
            }
        }