-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReportDialog.xaml.cs
More file actions
49 lines (39 loc) · 1.47 KB
/
ReportDialog.xaml.cs
File metadata and controls
49 lines (39 loc) · 1.47 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
39
40
41
42
43
44
45
46
47
48
49
using System.Windows;
namespace NetworkSpeedTest;
public partial class ReportDialog : Window
{
public bool IncludeSpeed { get; private set; }
public bool IncludeLatency { get; private set; }
public ReportDialog(bool hasSpeedResult, bool hasLatencyResult)
{
InitializeComponent();
IncludeSpeedCheck.IsEnabled = hasSpeedResult;
IncludeSpeedCheck.IsChecked = hasSpeedResult;
if (!hasSpeedResult)
IncludeSpeedCheck.Content = "Include Speed Test Results (no data)";
IncludeLatencyCheck.IsEnabled = hasLatencyResult;
IncludeLatencyCheck.IsChecked = hasLatencyResult;
if (!hasLatencyResult)
IncludeLatencyCheck.Content = "Include Latency Test Results (no data)";
// Disable Generate if nothing available
GenerateBtn.IsEnabled = hasSpeedResult || hasLatencyResult;
}
private void GenerateBtn_Click(object sender, RoutedEventArgs e)
{
IncludeSpeed = IncludeSpeedCheck.IsChecked == true;
IncludeLatency = IncludeLatencyCheck.IsChecked == true;
if (!IncludeSpeed && !IncludeLatency)
{
MessageBox.Show("Select at least one section to include.", "Nothing Selected",
MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
DialogResult = true;
Close();
}
private void CancelBtn_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
Close();
}
}