refactor: 项目稳定性优化

This commit is contained in:
2026-01-17 17:00:15 +08:00
parent 7abd445039
commit c276e9e2b9
7 changed files with 135 additions and 110 deletions

View File

@@ -6,11 +6,11 @@ namespace TimerApp
{
public class RestForm : Form
{
private Label lblMessage;
private Label lblTimer;
private Button btnSkip;
private Label lblMessage = null!;
private Label lblTimer = null!;
private Button btnSkip = null!;
public event EventHandler SkipRequested;
public event EventHandler? SkipRequested;
public RestForm()
{
@@ -99,12 +99,12 @@ namespace TimerApp
this.PerformLayout();
}
private void RestForm_Load(object sender, EventArgs e)
private void RestForm_Load(object? sender, EventArgs e)
{
CenterControls();
}
private void RestForm_Resize(object sender, EventArgs e)
private void RestForm_Resize(object? sender, EventArgs e)
{
CenterControls();
}
@@ -153,7 +153,7 @@ namespace TimerApp
}
}
private void btnSkip_Click(object sender, EventArgs e)
private void btnSkip_Click(object? sender, EventArgs e)
{
SkipRequested?.Invoke(this, EventArgs.Empty);
this.Close();