BizHawk/BizHawk.Client.DiscoHawk/ProgressDialog.cs

52 lines
1.1 KiB
C#
Raw Normal View History

2011-08-07 03:21:03 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
2013-11-03 13:19:36 +00:00
using System.Globalization;
2011-08-07 03:21:03 +00:00
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BizHawk.Emulation.DiscSystem;
namespace BizHawk.Client.DiscoHawk
2011-08-07 03:21:03 +00:00
{
public partial class ProgressDialog : Form
{
public ProgressDialog(ProgressReport pr)
2011-08-07 03:21:03 +00:00
{
InitializeComponent();
this.pr = pr;
}
ProgressReport pr;
2011-08-07 03:21:03 +00:00
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;
}
2013-11-03 13:19:36 +00:00
lblMessage.Text = pr.Message + " - " + progressBar1.Value.ToString(CultureInfo.CurrentCulture) + "%";
2011-08-07 03:21:03 +00:00
}
private void ProgressDialog_Load(object sender, EventArgs e)
{
}
2011-08-07 03:21:03 +00:00
}
}