-
Notifications
You must be signed in to change notification settings - Fork 8
/
LoadingWindow.cs
36 lines (31 loc) · 1021 Bytes
/
LoadingWindow.cs
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
34
35
36
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 ShootBlues {
public partial class LoadingWindow : Form {
public LoadingWindow () {
InitializeComponent();
}
private void LoadingWindow_FormClosing (object sender, FormClosingEventArgs e) {
}
public void SetProgress (float? progress) {
if (progress.HasValue) {
ProgressBar.Style = ProgressBarStyle.Continuous;
ProgressBar.Value = (int)Math.Floor(progress.Value * ProgressBar.Maximum);
} else {
ProgressBar.Style = ProgressBarStyle.Marquee;
}
}
public void SetStatus (string statusText, float? progress) {
StatusText.Text = statusText;
SetProgress(progress);
this.Refresh();
Application.DoEvents();
}
}
}