mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-09 05:34:51 +00:00
Created a new DebuggerHelper class with Lazy<bool> initialization that is shared by both LaunchOrderDetector and UnpackagedDetector. This eliminates code duplication and provides a cleaner, more maintainable solution. - Added DebuggerHelper.cs with lazy-initialized IsAttached property - Refactored LaunchOrderDetector to use DebuggerHelper - Refactored UnpackagedDetector to use DebuggerHelper - Removed nullable bool pattern in favor of Lazy<bool>
19 lines
544 B
C#
19 lines
544 B
C#
namespace ElectronNET.Runtime.Helpers
|
|
{
|
|
using System;
|
|
using System.Diagnostics;
|
|
|
|
/// <summary>
|
|
/// Helper class for debugger detection with lazy initialization.
|
|
/// </summary>
|
|
internal static class DebuggerHelper
|
|
{
|
|
/// <summary>
|
|
/// Gets whether a debugger is attached. This value is cached for performance.
|
|
/// </summary>
|
|
public static bool IsAttached => _isAttached.Value;
|
|
|
|
private static readonly Lazy<bool> _isAttached = new Lazy<bool>(() => Debugger.IsAttached);
|
|
}
|
|
}
|