Geastione avvio programma in cieco

This commit is contained in:
Nicola Pievani
2024-10-07 19:48:54 +02:00
parent 1d65a311f3
commit ac9f8354cc
3 changed files with 41 additions and 3 deletions
+7 -2
View File
@@ -11,8 +11,13 @@ Class Application
' Creo la View principale
Me.MainWindow = New MainWindowV(e.Args)
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(Me.MainWindow)
' Mostro la View principale
Me.MainWindow.Show()
If OptionModule.AdjustDDT Then
Me.MainWindow.Hide()
Else
Me.MainWindow.Show()
End If
'' Mostro la View principale
'Me.MainWindow.Show()
End Sub
End Class
+31
View File
@@ -14,6 +14,7 @@ Class MainWindowV
' Esempio:"Argomento 1 di prova" "Argomento 2 di prova"
If args.Length > 0 Then
m_args = args
RunBlindCode()
End If
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
@@ -64,4 +65,34 @@ Class MainWindowV
#End Region ' EVENTS
Private Sub RunBlindCode()
If Map.refSceneManagerVM.bProtectKey Then
If Not IsNothing(m_args) Then
' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF
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
' TERMINO TUTTO SUBITO!
End
End If
End If
Map.refMainWindowVM.SetLauncher()
Map.refMainWindowVM.ShowErrorCompoLoad()
End If
End Sub
End Class
+3 -1
View File
@@ -67,7 +67,9 @@ Public Class MainWindowVM
Set(value As ListPageEnum)
m_SelectedPage = value
NotifyPropertyChanged("PageControl")
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
If Not IsNothing(Map.refInstrumentPanelVM) Then
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
End If
End Set
End Property