-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathR.cs
41 lines (35 loc) · 1.25 KB
/
R.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MQTTStressTest
{
static class R
{
public static bool IsSlog { get; set; }
public static void Slog(string msg)
{
if (IsSlog)
{
Console.WriteLine(msg);
}
}
public static void ShowInfo(string msg) {
System.Windows.MessageBox.Show(msg, "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information);
}
public static void ShowWarning(string msg)
{
System.Windows.MessageBox.Show(msg, "警告", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning);
}
public static void ShowError(string msg)
{
System.Windows.MessageBox.Show(msg, "错误", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
}
public static bool ShowConfirm(string msg)
{
var result = System.Windows.MessageBox.Show(msg, "确认", System.Windows.MessageBoxButton.OKCancel, System.Windows.MessageBoxImage.Question);
return result == System.Windows.MessageBoxResult.OK;
}
}
}