2011-08-07 03:21:03 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk
|
|
|
|
|
{
|
|
|
|
|
public partial class ProgressDialog : Form
|
|
|
|
|
{
|
|
|
|
|
public ProgressDialog(DiscSystem.ProgressReport pr)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.pr = pr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DiscSystem.ProgressReport pr;
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
btnCancel.Enabled = false;
|
|
|
|
|
pr.CancelSignal = true;
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-01 01:31:21 +00:00
|
|
|
|
new public void Update()
|
2011-08-07 03:21:03 +00:00
|
|
|
|
{
|
|
|
|
|
double curr = pr.ProgressCurrent;
|
|
|
|
|
double max = pr.ProgressEstimate;
|
2011-08-07 04:00:06 +00:00
|
|
|
|
if (pr.InfoPresent)
|
|
|
|
|
{
|
|
|
|
|
double value = curr/max*100;
|
|
|
|
|
int nValue = (int) value;
|
|
|
|
|
if (nValue < 0 || nValue > 100)
|
|
|
|
|
nValue = 0;
|
|
|
|
|
progressBar1.Value = nValue;
|
|
|
|
|
}
|
2011-09-01 01:31:21 +00:00
|
|
|
|
lblMessage.Text = pr.Message + " - " + progressBar1.Value.ToString() + "%";
|
2011-08-07 03:21:03 +00:00
|
|
|
|
}
|
2011-08-30 22:35:57 +00:00
|
|
|
|
|
|
|
|
|
private void ProgressDialog_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2011-08-07 03:21:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|