1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 |
using System;
using System.Windows.Forms;
namespace Ayende.NHibernateQueryAnalyzer.UserInterface.Controls
{
public partial class Wait : Form
{
protected Wait()
{
InitializeComponent();
}
public Wait(string message, int checkInterval, int shouldWaitFor)
{
InitializeComponent();
ux_WaitText.Text = message;
ux_ProgressBar.Maximum = shouldWaitFor;
ux_ProgressBar.Step = checkInterval;
ux_Timer.Interval = checkInterval;
ux_Timer.Enabled = true;
}
private void ux_Timer_Tick(object sender, EventArgs e)
{
if (ux_ProgressBar.Value == ux_ProgressBar.Maximum)
ux_ProgressBar.Value = ux_ProgressBar.Minimum;
else
ux_ProgressBar.PerformStep();
}
}
} |