Files
EgtDOORCreator/MainWindow/MainWindowV.xaml.vb
T
2024-10-04 13:32:08 +02:00

65 lines
2.3 KiB
VB.net

Imports EgtWPFLib5
Class MainWindowV
Private m_args() As String = Nothing
#Region "EVENTS"
Public Sub New(args As String())
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
If args.Length > 0 Then
m_args = args
End If
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
End Sub
Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
End Sub
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
' se è assente la chiave di protezione non mostro la finestra Launcher
If Map.refSceneManagerVM.bProtectKey Then
If Not IsNothing(m_args) Then
' leggo gli argomenti
Dim Items() As String = m_args(0).Split(";"c)
If Items.Length = 5 Then
' Avvio progetto - LauncherOpt.Open_last_project (1)
OptionModule.m_bLauncherOpenOnce = True
' Indico il percorso del file
OptionModule.FileNameFromArgs = Items(0)
' Assegno i valore Width, Height, Thickness
OptionModule.m_Width = Items(1)
OptionModule.m_Height = Items(2)
OptionModule.m_Thickness = Items(3)
' Indico il percoso di salvataggio file DDF
OptionModule.SaveFileNameFromArgs = Items(4)
' abilito lettura dati
OptionModule.AdjustDDT = True
Else
' blocco lettura dati
OptionModule.AdjustDDT = False
End If
End If
Map.refMainWindowVM.SetLauncher()
Map.refMainWindowVM.ShowErrorCompoLoad()
End If
End Sub
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
' Salvo posizione finestra (se non minimizzata)
If WindowState <> WindowState.Minimized Then
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
End If
End Sub
#End Region ' EVENTS
End Class