From c9f47e23f25f7642f38ccf51608f26ee5574756e Mon Sep 17 00:00:00 2001 From: RenzoL Date: Fri, 25 Jun 2021 12:04:27 +0200 Subject: [PATCH 1/2] Aggiunta gestione file MRU (per Visualizzatore e Ottimizzatore) --- .../Constants/ConstIni.vb | 3 + .../OpenProjectFileDialogVM.vb | 4 + .../ProdManager/ProdManagerV.xaml | 12 +++ .../ProdManager/ProdManagerVM.vb | 79 ++++++++++++++++--- .../ProjManager/ProjManagerV.xaml | 13 +++ .../ProjManager/ProjManagerVM.vb | 51 ++++++++++++ .../ProjectManager/ProdFileVM.vb | 2 + .../ProjectManager/ProjFileVM.vb | 2 + .../SceneHost/MySceneHostVM.vb | 39 ++++++++- 9 files changed, 191 insertions(+), 14 deletions(-) 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/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index b20d6b86..478b33dc 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -284,6 +284,8 @@ Public Class OpenProjectFileDialogVM MessageBox.Show(EgtMsg(61873), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning) Return End If + Map.refProjManagerVM.m_MruFiles.Remove(SelProject.sProjPath) + Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) ' cancello progetto DbControllers.m_ProjController.DeleteProj(SelProject.nProjId) ' aggiorno lista progetti @@ -304,6 +306,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 600271a4..8f136061 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml @@ -12,6 +12,18 @@ ContextMenuService.Placement="Bottom" Tag="{Binding}" Style="{StaticResource ToolBar_Button}"> + + + + + + + +