43 lines
1.6 KiB
C#
43 lines
1.6 KiB
C#
namespace AVSCartonShipmentVerifier.Configuration;
|
|
|
|
public sealed class DesktopHostOptions
|
|
{
|
|
public const string SectionName = "DesktopHost";
|
|
|
|
/// <summary>
|
|
/// When true (default on Windows), opens the default browser after the server starts.
|
|
/// </summary>
|
|
public bool LaunchBrowser { get; init; } = true;
|
|
|
|
/// <summary>
|
|
/// Optional URL to open. If empty, the first bound HTTP address from Kestrel is used.
|
|
/// </summary>
|
|
public string? BrowserUrl { get; init; }
|
|
|
|
/// <summary>
|
|
/// When true (default for published desktop exe), stops the host when the launched browser window closes.
|
|
/// </summary>
|
|
public bool ExitWhenBrowserCloses { get; init; } = true;
|
|
|
|
/// <summary>
|
|
/// Seconds to wait after the page unloads before shutdown (allows cancel on reload).
|
|
/// </summary>
|
|
public int BrowserShutdownDelaySeconds { get; init; } = 2;
|
|
|
|
/// <summary>
|
|
/// Prefer Edge/Chrome app-mode window (trackable process) on Windows before the default browser.
|
|
/// </summary>
|
|
public bool PreferAppModeBrowser { get; init; } = true;
|
|
|
|
/// <summary>
|
|
/// Dedicated Edge/Chrome profile directory so app-mode uses a trackable browser process.
|
|
/// </summary>
|
|
public string BrowserUserDataDir { get; init; } =
|
|
@"C:\Users\Public\AVSCartonShipmentVerifier\browser-profile";
|
|
|
|
/// <summary>
|
|
/// If the tracked browser process exits sooner than this, treat it as a launcher handoff (do not stop the app).
|
|
/// </summary>
|
|
public int MinimumBrowserProcessLifetimeSeconds { get; init; } = 5;
|
|
}
|