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() ' Per leggere più argomenti devono essere scritti ognuno tra doppi apici e separati da spazio ' 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(). 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 RunBlindCode() 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 Private Sub RunBlindCode() If Map.refSceneManagerVM.bProtectKey Then ReadArgs() Map.refMainWindowVM.SetLauncher() Map.refMainWindowVM.ShowErrorCompoLoad() End If End Sub ' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati Private Sub ReadArgs() If Not IsNothing(m_args) Then StartBlinProgdLog(IniFile.m_sTempDir & "\BlindProgLog.txt") ' 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) BlindProgLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs) ' Assegno i valore Width, Height, Thickness OptionModule.m_Width = Items(1) BlindProgLog(" width : " & OptionModule.m_Width) OptionModule.m_Height = Items(2) BlindProgLog(" height : " & OptionModule.m_Height) OptionModule.m_Thickness = Items(3) BlindProgLog(" thickness : " & OptionModule.m_Thickness) ' Indico il percoso di salvataggio file DDF OptionModule.SaveFileNameFromArgs = Items(4) BlindProgLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs) ' Nuovo parametro da laggere per gestione Swing If Items.Length = 6 Then OptionModule.ForcesSideSwing = Items(5) BlindProgLog(" swing : " & OptionModule.ForcesSideSwing) End If ' abilito lettura dati OptionModule.AdjustDDT = True Else ' blocco lettura dati OptionModule.AdjustDDT = False ' TERMINO TUTTO SUBITO! End End If End If End Sub End Class