Option Strict On
Option Explicit On

Namespace Nexamas.UI.Components.Governance

    Friend NotInheritable Class MASButtonReadinessManifest
        Friend Sub New(hasArchitectureRegistration As Boolean,
                       hasActivationPolicy As Boolean,
                       hasCommandBoundaryProtection As Boolean,
                       hasBusyAndTextLayoutInvalidation As Boolean,
                       hasOfficialRendererRoute As Boolean,
                       hasNoParallelNativeButtonPath As Boolean)
            Me.HasArchitectureRegistration = hasArchitectureRegistration
            Me.HasActivationPolicy = hasActivationPolicy
            Me.HasCommandBoundaryProtection = hasCommandBoundaryProtection
            Me.HasBusyAndTextLayoutInvalidation = hasBusyAndTextLayoutInvalidation
            Me.HasOfficialRendererRoute = hasOfficialRendererRoute
            Me.HasNoParallelNativeButtonPath = hasNoParallelNativeButtonPath
        End Sub

        Friend ReadOnly Property HasArchitectureRegistration As Boolean
        Friend ReadOnly Property HasActivationPolicy As Boolean
        Friend ReadOnly Property HasCommandBoundaryProtection As Boolean
        Friend ReadOnly Property HasBusyAndTextLayoutInvalidation As Boolean
        Friend ReadOnly Property HasOfficialRendererRoute As Boolean
        Friend ReadOnly Property HasNoParallelNativeButtonPath As Boolean

        Friend ReadOnly Property Status As MASButtonReadinessStatus
            Get
                If Not HasArchitectureRegistration Then Return MASButtonReadinessStatus.BlockedByMissingArchitectureRegistration
                If Not HasActivationPolicy Then Return MASButtonReadinessStatus.BlockedByMissingActivationPolicy
                If Not HasCommandBoundaryProtection Then Return MASButtonReadinessStatus.BlockedByMissingCommandBoundary
                If Not HasBusyAndTextLayoutInvalidation Then Return MASButtonReadinessStatus.BlockedByMissingLayoutInvalidation
                If Not HasOfficialRendererRoute OrElse Not HasNoParallelNativeButtonPath Then Return MASButtonReadinessStatus.BlockedByParallelButtonPath
                Return MASButtonReadinessStatus.Ready
            End Get
        End Property

        Friend ReadOnly Property IsReady As Boolean
            Get
                Return Status = MASButtonReadinessStatus.Ready
            End Get
        End Property

        Friend Shared Function CreateCurrent() As MASButtonReadinessManifest
            Return New MASButtonReadinessManifest(
                hasArchitectureRegistration:=True,
                hasActivationPolicy:=True,
                hasCommandBoundaryProtection:=True,
                hasBusyAndTextLayoutInvalidation:=True,
                hasOfficialRendererRoute:=True,
                hasNoParallelNativeButtonPath:=True)
        End Function
    End Class

End Namespace
