forked from DongwanCho/IfcDoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FormProgress.cs
67 lines (60 loc) · 1.33 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
60
61
62
63
64
65
66
67
// 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)
{
if (step >= 0)
{
this.progressBar.Maximum = this.m_progressmax;
if (step <= this.progressBar.Maximum)
{
this.progressBar.Value = step;
}
}
else
{
this.Text += " - Error";
this.buttonCancel.Text = "Close";
}
if (state != null)
{
this.textBoxStatus.Text = this.textBoxStatus.Text + "\r\n" + state.ToString();
this.textBoxStatus.Select(this.textBoxStatus.Text.Length, 0);
this.textBoxStatus.ScrollToCaret();
}
}
}
}