Files
Nicola Pievani 0bc8e470b9 EgtDOORCreator 1.8j1 :
- creazione di assemblati
2017-11-21 16:07:47 +00:00

138 lines
3.4 KiB
VB.net

Imports EgtUILib
Imports System.IO
Public Class LauncherVM
' Riferimento al MainWindowVM
Private m_rfMainWindowVM As MainWindowVM
#Region "MESSAGES"
Public ReadOnly Property TitleMsg As String
Get
Return EgtMsg(MSG_LAUNCHER)
End Get
End Property
Public ReadOnly Property NewMsg As String
Get
Return EgtMsg(MSG_LAUNCHER + 1)
End Get
End Property
Public ReadOnly Property OpenMsg As String
Get
Return EgtMsg(MSG_LAUNCHER + 2)
End Get
End Property
Public ReadOnly Property OpenLastMsg As String
Get
Return EgtMsg(MSG_LAUNCHER + 3)
End Get
End Property
#End Region ' Messages
' Definizione comando
Private m_CmdOpenNew As ICommand
Private m_CmdOpen As ICommand
Private m_CmdLastProject As ICommand
Private m_CmdCloseLauncher As ICommand
Sub New(MainWindowVM As MainWindowVM)
m_rfMainWindowVM = MainWindowVM
End Sub
#Region "COMMANDS"
#Region "OpenNew"
Public ReadOnly Property OpenNewCommand As ICommand
Get
If m_CmdOpenNew Is Nothing Then
m_CmdOpenNew = New Command(AddressOf OpenNew)
End If
Return m_CmdOpenNew
End Get
End Property
Public Sub OpenNew()
' rimando alla funzione che già esiste all'interno del projectmanager per la creazione di un nuovo progetto
Map.refProjectManagerVM.NewCmd()
CloseLauncher()
End Sub
#End Region ' Open New
#Region "Open"
Public ReadOnly Property OpenCommand As ICommand
Get
If m_CmdOpen Is Nothing Then
m_CmdOpen = New Command(AddressOf Open)
End If
Return m_CmdOpen
End Get
End Property
Public Sub Open()
' rimando alla funzione che già esiste all'interno del projectmanager per l'apertura di un progetto
Map.refProjectManagerVM.Open()
CloseLauncher()
End Sub
#End Region ' Open
#Region "LastProject"
Public ReadOnly Property LastProjectCommand As ICommand
Get
If m_CmdLastProject Is Nothing Then
m_CmdLastProject = New Command(AddressOf OpenLastProject)
End If
Return m_CmdLastProject
End Get
End Property
Public Sub OpenLastProject()
' Apro l'ultimo progetto
Map.refProjectManagerVM.OpenLastProject()
CloseLauncher()
End Sub
#End Region ' LastProject
#Region "CloseLauncherCommand"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property CloseLauncherCommand() As ICommand
Get
If m_CmdCloseLauncher Is Nothing Then
m_CmdCloseLauncher = New Command(AddressOf CloseLauncher)
End If
Return m_CmdCloseLauncher
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub CloseLauncher()
' Chiusura finestra
For Each Window In Application.Current.Windows
If TypeOf Window Is LauncherV Then
Dim LauncherWindow As LauncherV = DirectCast(Window, LauncherV)
LauncherWindow.Close()
End If
Next
End Sub
#End Region ' CloseOptionsCommand
#End Region ' COMMANDS
End Class