Option Strict On
Option Explicit On

Imports System.Text

Namespace Nexamas.UI.Architecture

    Friend NotInheritable Class MASInteractionStateReport

        Private Sub New()
        End Sub

        Friend Shared Function BuildReport() As String

            Dim sb As New StringBuilder()

            sb.AppendLine("MAS Interaction State Report")
            sb.AppendLine("============================")
            sb.AppendLine()

            Dim allStates =
                MASInteractionStateResolver.ResolveAll()

            Dim index As Integer = 0

            For Each item As MASComponentStateSnapshot In allStates

                index += 1

                sb.AppendLine(index.ToString() & ". " &
                              item.ComponentType.FullName)

                sb.AppendLine("   States: " &
                              item.States.ToString())

                sb.AppendLine()

            Next

            sb.AppendLine("Total components: " & index.ToString())

            Return sb.ToString()

        End Function

    End Class

End Namespace