diff --git a/EgtBEAMWALL.ViewerOptimizer/Constants/ConstIni.vb b/EgtBEAMWALL.ViewerOptimizer/Constants/ConstIni.vb index f8a35fde..f62aeddd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Constants/ConstIni.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Constants/ConstIni.vb @@ -113,4 +113,7 @@ Module ConstIni Public Const K_BEAMWALLBASEDIR As String = "BaseDir" Public Const K_BEAMWALLBUTTON As String = "Button" + Public Const S_MRUPROJFILES As String = "MruProjFiles" + Public Const S_MRUPRODFILES As String = "MruProdFiles" + End Module diff --git a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb index db975ba9..475e3ae7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MainWindow/MainWindowVM.vb @@ -117,6 +117,16 @@ Public Class MainWindowVM 'Else ' Map.refProjectManagerVM.NewCmd() End If + ' setto il primo file dalla lista degli MRU come progetto corrente da aprire + Dim sLastProjectPath As String = String.Empty + GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath) + If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then + ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo + Dim PjId As Integer = 0 + Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath) + Integer.TryParse(sPjId, PjId) + Map.refProjManagerVM.SetCurrProj(PjId) + End If ' apro in modalita' VIEW Map.refMainMenuVM.SelPage = Pages.VIEW diff --git a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index 1cf968b0..0d57536f 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -274,7 +274,9 @@ Public Class OpenProjectFileDialogVM MessageBox.Show(EgtMsg(61873), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If - ' cancello progetto da Db + Map.refProjManagerVM.m_MruFiles.Remove(SelProject.sProjPath) + Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) + ' cancello progetto DbControllers.m_ProjController.DeleteProj(SelProject.nProjId) ' cancello cartella del Proj Try @@ -300,6 +302,8 @@ Public Class OpenProjectFileDialogVM MessageBox.Show(EgtMsg(61874), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If + Map.refProdManagerVM.m_MruFiles.Remove(SelProject.sProdPath) + Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) ' cancello progetto DbControllers.m_ProdController.DeleteProd(SelProject.nProdId) ' riporto prod in proj diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml index 8e17bfa2..8a23eed3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml @@ -13,6 +13,18 @@ ContextMenuService.Placement="Bottom" Tag="{Binding}" Style="{StaticResource ToolBar_Button}"> + + + + + + + +