-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDarkErrorDialog.cs
38 lines (32 loc) · 980 Bytes
/
DarkErrorDialog.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
using System;
using System.Windows.Forms;
using JetBrains.Annotations;
using static Update.Data;
namespace Update;
[PublicAPI]
public sealed class DarkErrorDialog : DarkTaskDialog
{
public DarkErrorDialog(
string message,
string? title = null,
MessageBoxIcon icon = MessageBoxIcon.Error) :
base(
message: message,
title: title ?? LText.AlertMessages.Error,
icon: icon,
yesText: LText.AlertMessages.Error_ViewLog,
noText: LText.Global.OK,
defaultButton: DialogResult.Yes)
{
AcceptButton = NoButton;
YesButton.DialogResult = DialogResult.None;
NoButton.DialogResult = DialogResult.OK;
YesButton.Click += YesButton_Click;
}
private void YesButton_Click(object sender, EventArgs e) => Program.OpenLogFile();
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
YesButton.Focus();
}
}