Option Strict On
Option Explicit On

Imports System

Namespace Nexamas.UI.CommandActions

     ''' <summary>
     ''' Immutable context passed to command handlers from button, menu, shortcut, toolbar, and future command surfaces.
     ''' </summary>
    Friend NotInheritable Class MASCommandExecutionContext

        Friend Sub New(commandId As String,
                       sourceKind As MASCommandBindingSurfaceKind,
                       sourceName As String,
                       parameter As Object)
            Me.CommandId = MASCommandRegistry.NormalizeCommandId(commandId)
            Me.SourceKind = sourceKind
            Me.SourceName = If(sourceName, String.Empty)
            Me.Parameter = parameter
            Me.ExecutedAtUtc = Nexamas.UI.Timing.MASTimeProvider.UtcNow()
        End Sub

        Friend ReadOnly Property CommandId As String
        Friend ReadOnly Property SourceKind As MASCommandBindingSurfaceKind
        Friend ReadOnly Property SourceName As String
        Friend ReadOnly Property Parameter As Object
        Friend ReadOnly Property ExecutedAtUtc As DateTime

    End Class

End Namespace
