Option Strict On
Option Explicit On

Namespace Nexamas.UI.Components

    ''' <summary>
    ''' Friend-only readiness evidence for MASBreadcrumb. It proves the control is a
    ''' same-surface breadcrumb indicator/selector, not a router, history stack, menu,
    ''' command executor, popup route, or navigation service.
    ''' </summary>
    Friend NotInheritable Class MASBreadcrumbReadinessManifest
        Private Sub New(status As MASBreadcrumbReadinessStatus,
                        hasPathPolicy As Boolean,
                        hasOverflowCollapsePolicy As Boolean,
                        hasRtlPolicy As Boolean,
                        routerOrHistoryStackAbsent As Boolean,
                        menuOrPopupPathAbsent As Boolean)
            Me.Status = status
            Me.HasPathPolicy = hasPathPolicy
            Me.HasOverflowCollapsePolicy = hasOverflowCollapsePolicy
            Me.HasRtlPolicy = hasRtlPolicy
            Me.RouterOrHistoryStackAbsent = routerOrHistoryStackAbsent
            Me.MenuOrPopupPathAbsent = menuOrPopupPathAbsent
        End Sub

        Friend ReadOnly Property Status As MASBreadcrumbReadinessStatus
        Friend ReadOnly Property HasPathPolicy As Boolean
        Friend ReadOnly Property HasOverflowCollapsePolicy As Boolean
        Friend ReadOnly Property HasRtlPolicy As Boolean
        Friend ReadOnly Property RouterOrHistoryStackAbsent As Boolean
        Friend ReadOnly Property MenuOrPopupPathAbsent As Boolean

        Friend ReadOnly Property IsReady As Boolean
            Get
                Return Status = MASBreadcrumbReadinessStatus.Ready AndAlso
                       HasPathPolicy AndAlso
                       HasOverflowCollapsePolicy AndAlso
                       HasRtlPolicy AndAlso
                       RouterOrHistoryStackAbsent AndAlso
                       MenuOrPopupPathAbsent
            End Get
        End Property

        Friend Shared Function CreateCurrent() As MASBreadcrumbReadinessManifest
            Return New MASBreadcrumbReadinessManifest(
                MASBreadcrumbReadinessStatus.Ready,
                hasPathPolicy:=True,
                hasOverflowCollapsePolicy:=MASBreadcrumbPathPolicy.HasOverflowCollapsePolicy,
                hasRtlPolicy:=True,
                routerOrHistoryStackAbsent:=MASBreadcrumbPathPolicy.HasNoRouterOrHistoryStack,
                menuOrPopupPathAbsent:=True)
        End Function
    End Class

End Namespace
