-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressDialog.xaml.cs
More file actions
38 lines (33 loc) · 1.07 KB
/
ProgressDialog.xaml.cs
File metadata and controls
38 lines (33 loc) · 1.07 KB
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
using System.Reflection.PortableExecutable;
using System.Windows;
namespace WindowsAdvancedAttributesManager
{
public partial class ProgressDialog : Window
{
public ProgressDialog()
{
InitializeComponent();
}
public void UpdateMessage(string header, string message, long items = 0, long start = 0, long seconds = 0, bool spin = true, bool allowClose = false)
{
Header.Text = header;
Message.Text = message;
if (items > 0) {
long elapsed = seconds - start == 0 ? 1 : seconds - start;
Items.Text = $"Processed items: {items} ({items / elapsed}/s)";
}
if (!spin)
{
Spinner.Visibility = Visibility.Hidden;
}
if (allowClose)
{
Close_Button.Visibility = Visibility.Visible;
}
}
private void Close_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}