Option Strict On
Option Explicit On

Namespace Nexamas.UI.Application

    ''' <summary>
    ''' Application-level runtime startup and diagnostics options.
    ''' </summary>
    ''' <remarks>
    ''' The defaults favor responsive first-window startup: strict validation remains enabled, while expensive report
    ''' generation and disk diagnostics are opt-in. Configure these options before creating the first MASApplicationWindow.
    ''' </remarks>
    Friend NotInheritable Class MASApplicationRuntimeOptions

        Friend Property WriteArchitectureReportsOnStartup As Boolean = False

        Friend Property WriteDeepArchitectureReportsOnStartup As Boolean = False

        Friend Property RegisterDefaultIconCatalogOnStartup As Boolean = True

        Friend Property EnableDiagnosticsDiskLogging As Boolean = False

        Friend Property ThrowOnSwallowedException As Boolean = False

        Friend Property ThrowOnLifecycleBreakingException As Boolean = False

        Friend Property TraceRepeatedBoundaryExceptions As Boolean = False

        ''' <summary>
        ''' Development/test option. When enabled, MASControlBase construction throws immediately
        ''' if the architecture contract probe cannot resolve the control type.
        ''' Production/default mode keeps construction permissive and fails at ControlsLayer admission.
        ''' </summary>
        Friend Property FailFastOnContractlessControlConstruction As Boolean = False

        Friend Function Clone() As MASApplicationRuntimeOptions
            Return New MASApplicationRuntimeOptions() With {
                .WriteArchitectureReportsOnStartup = Me.WriteArchitectureReportsOnStartup,
                .WriteDeepArchitectureReportsOnStartup = Me.WriteDeepArchitectureReportsOnStartup,
                .RegisterDefaultIconCatalogOnStartup = Me.RegisterDefaultIconCatalogOnStartup,
                .EnableDiagnosticsDiskLogging = Me.EnableDiagnosticsDiskLogging,
                .ThrowOnSwallowedException = Me.ThrowOnSwallowedException,
                .ThrowOnLifecycleBreakingException = Me.ThrowOnLifecycleBreakingException,
                .TraceRepeatedBoundaryExceptions = Me.TraceRepeatedBoundaryExceptions,
                .FailFastOnContractlessControlConstruction = Me.FailFastOnContractlessControlConstruction
            }
        End Function

    End Class

End Namespace
