f365dee1c7
- Asterisco in fase di modifica; - salvataggio in caso di cambio porta solo se presente asterisco; - asterisco in fase di creazione nuova porta.
138 lines
3.5 KiB
VB.net
138 lines
3.5 KiB
VB.net
Imports EgtUILib
|
|
Imports System.IO
|
|
|
|
Public Class LauncherViewModel
|
|
' Riferimento al MainWindowViewModel
|
|
Private m_rfMainWindowViewModel As MainWindowViewModel
|
|
|
|
#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(MainWindowViewModel As MainWindowViewModel)
|
|
m_rfMainWindowViewModel = MainWindowViewModel
|
|
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
|
|
m_rfMainWindowViewModel.ProjectManagerViewModel.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
|
|
m_rfMainWindowViewModel.ProjectManagerViewModel.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
|
|
m_rfMainWindowViewModel.ProjectManagerViewModel.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 LauncherView Then
|
|
Dim LauncherWindow As LauncherView = DirectCast(Window, LauncherView)
|
|
LauncherWindow.Close()
|
|
End If
|
|
Next
|
|
End Sub
|
|
|
|
#End Region ' CloseOptionsCommand
|
|
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|