Option Strict On
Option Explicit On

Imports System
Imports Nexamas.UI.FloatRuntime

Namespace Nexamas.UI.Application

    ''' <summary>
    ''' Public SDK event data delivered after an application surface opens.
    ''' </summary>
    Public NotInheritable Class MASApplicationOpenedEventArgs
        Inherits EventArgs

        Public ReadOnly Property Handle As MASApplicationSurfaceHandle

        Public ReadOnly Property SurfaceKey As String

        Public ReadOnly Property OwnerKey As String

        Friend Sub New(handle As MASApplicationSurfaceHandle)
            If handle Is Nothing Then Throw New ArgumentNullException(NameOf(handle))

            Me.Handle = handle
            Me.SurfaceKey = handle.SurfaceKey
            Me.OwnerKey = handle.OwnerKey
        End Sub

        Friend Shared Function FromFloatHandle(handle As MASFloatHandle) As MASApplicationOpenedEventArgs
            Dim appHandle As MASApplicationSurfaceHandle = MASApplicationSurfaceHandle.FromFloatHandle(handle)
            If appHandle Is Nothing Then Return Nothing
            Return New MASApplicationOpenedEventArgs(appHandle)
        End Function

    End Class

End Namespace
