BioCore  5.0.0
A Windows .NET microscopy library and application for viewing, editing, and annotating images.
Loading...
Searching...
No Matches
Progress.cs
Go to the documentation of this file.
1using System.ComponentModel;
2using System.Diagnostics;
3
4namespace BioCore
5{
6 public partial class Progress : Form
7 {
8 Stopwatch watch = new Stopwatch();
9 /* A constructor. */
10 public Progress(string file, string status)
11 {
12 InitializeComponent();
13 watch.Start();
14 statusLabel.Text = status;
15 fileLabel.Text = file;
16 timer.Start();
17 }
22 public void UpdateProgress(int p)
23 {
24 progressBar.Value = p;
25 }
30 public void UpdateProgressF(float p)
31 {
32 if (p > 1)
33 progressBar.Value = 100;
34 else
35 progressBar.Value = (int)(p * 100);
36 }
37
43 private void timer_Tick(object sender, EventArgs e)
44 {
45 timeLabel.Text = watch.Elapsed.Seconds + "." + watch.Elapsed.Milliseconds + "s";
46 }
47 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
48 public string Status
49 {
50 get { return statusLabel.Text; }
51 set { statusLabel.Text = value; }
52 }
53 }
54}
void UpdateProgressF(float p)
Definition Progress.cs:30
Progress(string file, string status)
Definition Progress.cs:10
void UpdateProgress(int p)
Definition Progress.cs:22