-
Notifications
You must be signed in to change notification settings - Fork 64
/
FormProgress.cs
59 lines (52 loc) · 1.5 KB
/
FormProgress.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Name: FormProgress.cs
// Description: Dialog box for showing progress while performing background operations.
// Author: Tim Chipman
// Origination: Work performed for BuildingSmart by Constructivity.com LLC.
// Copyright: (c) 2012 BuildingSmart International Ltd.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace IfcDoc
{
public partial class FormProgress : Form
{
int m_progressmax = 100;
public FormProgress()
{
InitializeComponent();
}
public string Description
{
get
{
return this.label1.Text;
}
set
{
this.label1.Text = value;
}
}
public void SetProgressTotal(int total)
{
this.m_progressmax = total;
}
public void ReportProgress(int step, object state)
{
this.progressBar.Maximum = this.m_progressmax;
if (step <= this.progressBar.Maximum)
{
this.progressBar.Value = step;
}
if (state != null)
{
this.textBoxStatus.Text = this.textBoxStatus.Text + "\r\n" + state.ToString();
this.textBoxStatus.Select(this.textBoxStatus.Text.Length, 0);
this.textBoxStatus.ScrollToCaret();
}
}
}
}