Ejemplo n.º 1
0
        private int doStep(ref BisectStep bss)
        {
            /* System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); // Time measurement
             * sw.Start();*/
            // Checkout
            git.Checkout(bss.getCommit(), CheckoutModifiers.Force, (path, completed, total) =>
            {
                progressBar1.Value = total == 0 ? 100 : (int)((((float)completed) / total) * 100);
            }, null);

            /* sw.Stop();
             * MessageBox.Show(sw.ElapsedMilliseconds / 1000f + "sec(" + bss.getCommit().Sha + ")");*/
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo = new System.Diagnostics.ProcessStartInfo(System.IO.Path.Combine(new string[] { tb_ondisk.Text, PATH_SOFFICE_EXE }));
            if (System.IO.File.Exists(p.StartInfo.FileName))
            {
                p.Start();
            }
            else
            {
                return(BisectStep.Result.SKIP);
            }
            GBS          form   = new GBS();
            DialogResult dr     = form.ShowDialog();
            int          result = int.MaxValue;

            while (!p.HasExited)
            {
                MessageBox.Show("Please close LibreOffice to continue!", "Close LibreOffice", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            switch (dr)
            {
            case (DialogResult.Yes):
                result = BisectStep.Result.GOOD;
                break;

            case (DialogResult.No):
                result = BisectStep.Result.BAD;
                break;

            case (DialogResult.Ignore):
                result = BisectStep.Result.SKIP;
                break;
            }
            bss.setResult(result);
            return(result);
        }
Ejemplo n.º 2
0
 private int doStep(ref BisectStep bss)
 {
     /* System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); // Time measurement
      sw.Start();*/
     // Checkout
     git.Checkout(bss.getCommit(), CheckoutModifiers.Force, (path, completed, total) =>
     {
         progressBar1.Value = total == 0 ? 100 : (int)((((float)completed) / total) * 100);
     }, null);
     /* sw.Stop();
      MessageBox.Show(sw.ElapsedMilliseconds / 1000f + "sec(" + bss.getCommit().Sha + ")");*/
     System.Diagnostics.Process p = new System.Diagnostics.Process();
     p.StartInfo = new System.Diagnostics.ProcessStartInfo(System.IO.Path.Combine(new string[] { tb_ondisk.Text, PATH_SOFFICE_EXE }));
     if (System.IO.File.Exists(p.StartInfo.FileName))
         p.Start();
     else
         return BisectStep.Result.SKIP;
     GBS form = new GBS();
     DialogResult dr = form.ShowDialog();
     int result = int.MaxValue;
     while (!p.HasExited)
         MessageBox.Show("Please close LibreOffice to continue!", "Close LibreOffice", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     switch (dr)
     {
         case (DialogResult.Yes):
             result = BisectStep.Result.GOOD;
             break;
         case (DialogResult.No):
             result = BisectStep.Result.BAD;
             break;
         case (DialogResult.Ignore):
             result = BisectStep.Result.SKIP;
             break;
     }
     bss.setResult(result);
     return result;
 }