Skip to content

Commit 2f41a7d

Browse files
committed
Cleaned up TODOs
1 parent 3c11684 commit 2f41a7d

3 files changed

Lines changed: 4 additions & 28 deletions

File tree

InfoBox/Context/InformationBoxScope.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ public class InformationBoxScope : IDisposable
1616
{
1717
#region Attributes
1818

19-
// TODO: [P1.1] Replace static Stack with AsyncLocal<Stack<InformationBoxScope>> for thread-safety
20-
// See TESTABILITY_ROADMAP.md - current implementation is not thread-safe for concurrent tests
21-
// private static readonly AsyncLocal<Stack<InformationBoxScope>> _scopeStack = new AsyncLocal<Stack<InformationBoxScope>>();
22-
// Also add IInformationBoxScope interface and TestScopeProvider for dependency injection in tests
2319
/// <summary>
2420
/// Stack of all scopes
2521
/// </summary>

InfoBox/Form/InformationBoxForm.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,9 @@ internal InformationBoxForm(string text,
288288
InformationBoxSound sound = InformationBoxSound.Default)
289289
{
290290
this.InitializeComponent();
291-
// TODO: [P0.2] Replace CreateGraphics with ITextMeasurement interface injection
292-
// See TESTABILITY_ROADMAP.md - this prevents headless testing
293291
this.measureGraphics = CreateGraphics();
294292
this.measureGraphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
295293

296-
// TODO: [P1.3] Replace SystemFonts with ISystemResources interface injection
297-
// See TESTABILITY_ROADMAP.md - this prevents testing without system fonts
298294
// Apply default font for message boxes
299295
this.Font = SystemFonts.MessageBoxFont;
300296
this.messageText.Font = SystemFonts.MessageBoxFont;
@@ -646,8 +642,6 @@ internal InformationBoxResult Show(out CheckState state)
646642
/// </summary>
647643
private void PlaySound()
648644
{
649-
// TODO: [P1.3] Replace SystemSounds with ISystemResources.PlaySound(InformationBoxSound)
650-
// See TESTABILITY_ROADMAP.md - this entire method logic should move to WindowsSystemResources
651645
if (sound == InformationBoxSound.None)
652646
{
653647
return;
@@ -1007,8 +1001,6 @@ private void SetFocus()
10071001
/// </summary>
10081002
private void SetLayout()
10091003
{
1010-
// TODO: [P0.1] Extract this 110-line method to InformationBoxPresenter.CalculateLayout()
1011-
// See TESTABILITY_ROADMAP.md - this complex layout logic should be testable without WinForms
10121004
int totalHeight;
10131005
int totalWidth;
10141006

@@ -1068,8 +1060,6 @@ private void SetLayout()
10681060

10691061
totalHeight = Math.Max(iconHeight, textHeight) + BorderPadding * 2 + this.pnlBas.Height;
10701062

1071-
// TODO: [P1.3] Replace Screen.PrimaryScreen with ISystemResources.GetWorkingArea()
1072-
// See TESTABILITY_ROADMAP.md - hardcoded screen metrics prevent testing with different screen sizes
10731063
// Add a small space to avoid vertical scrollbar.
10741064
if (iconAndTextWidth > Screen.PrimaryScreen.WorkingArea.Width - 100)
10751065
{
@@ -1341,8 +1331,6 @@ private void SetText()
13411331
/// </summary>
13421332
private void SetButtons()
13431333
{
1344-
// TODO: [P0.1] Extract button generation logic to InformationBoxPresenter.GetButtons()
1345-
// See TESTABILITY_ROADMAP.md - this logic should return List<ButtonDefinition> without WinForms dependencies
13461334
// Abort button
13471335
if (this.buttons == InformationBoxButtons.AbortRetryIgnore)
13481336
{
@@ -1698,8 +1686,6 @@ private void InformationBoxForm_KeyDown(object sender, KeyEventArgs e)
16981686
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
16991687
private void TmrAutoClose_Tick(object sender, EventArgs e)
17001688
{
1701-
// TODO: [P0.1] Extract this 115-line timer logic to InformationBoxPresenter.UpdateAutoClose(TimeSpan elapsed)
1702-
// See TESTABILITY_ROADMAP.md - this should be a pure function returning AutoCloseState without Timer dependencies
17031689
if (this.elapsedTime == this.autoClose.Seconds)
17041690
{
17051691
this.tmrAutoClose.Stop();

InfoBox/InformationBox.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,12 @@ namespace InfoBox
1313
/// <summary>
1414
/// Displays a message box that can contain text, buttons, and symbols that inform and instruct the user.
1515
/// </summary>
16-
#if !NET5_0_OR_GREATER
16+
#if !NET5_0_OR_GREATER
1717
[UIPermission(SecurityAction.Demand)]
18-
#endif
18+
#endif
1919
public static class InformationBox
2020
{
21-
// TODO: [P1.2] Add factory pattern for testability
22-
// See TESTABILITY_ROADMAP.md - Add IInformationBoxFactory and IInformationBoxDisplay interfaces
23-
// internal static IInformationBoxFactory Factory { get; set; } = new InformationBoxFactory();
24-
// This will allow tests to inject mock factories and test code that calls InformationBox.Show()
25-
26-
#region Show
21+
#region Show
2722

2823
/// <summary>
2924
/// Displays a message box with the specified text and parameters.
@@ -138,7 +133,6 @@ public static class InformationBox
138133
/// <returns>One of the <see cref="InformationBoxResult"/> values.</returns>
139134
public static InformationBoxResult Show(string text, params object[] parameters)
140135
{
141-
// TODO: [P1.2] Replace direct instantiation with Factory.Create(text, parameters).ShowModal()
142136
return new InformationBoxForm(text, parameters).Show();
143137
}
144138

@@ -429,6 +423,6 @@ public static InformationBoxResult Show(string text,
429423
style, autoClose, design, fontParameters, font, titleStyle, titleIcon, legacyButtons, legacyIcon, legacyDefaultButton, behavior, callback, opacity, parent, order, sound).Show(out checkBoxState);
430424
}
431425

432-
#endregion Show
426+
#endregion Show
433427
}
434428
}

0 commit comments

Comments
 (0)