Option Strict On
Option Explicit On

Imports System

Namespace Nexamas.UI.Architecture

    Friend NotInheritable Class MASComponentStateSnapshot

        Friend Sub New(componentType As Type,
                       states As MASInteractionStateSet)

            Me.ComponentType = componentType
            Me.States = states
        End Sub

        Friend ReadOnly Property ComponentType As Type
        Friend ReadOnly Property States As MASInteractionStateSet

        Friend Function Has(state As MASInteractionState) As Boolean
            Return States.Has(state)
        End Function

        Public Overrides Function ToString() As String

            Dim name As String =
                If(ComponentType Is Nothing,
                   "<null>",
                   ComponentType.Name)

            Return name & " => " & States.ToString()

        End Function

    End Class

End Namespace