diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb index 3aa0276..074da99 100644 --- a/AssemblyManager/AssemblyManagerVM.vb +++ b/AssemblyManager/AssemblyManagerVM.vb @@ -975,9 +975,9 @@ Public Class AssemblyManagerVM Else Dim LastProject As String = m_CurrProject.Name ' confermo che non devono essere prese inconsiderazione le modifiche - m_CurrProject.SelAssemblyName.IsModified = False + 'm_CurrProject.SelAssemblyName.IsModified = False ' elimino qualsiasi resto di porta - m_CurrProject.SelAssemblyName = Nothing + 'm_CurrProject.SelAssemblyName = Nothing ' pulisco entry page Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected ' aggiorno il titolo della pagina @@ -1514,7 +1514,11 @@ Public Class AssemblyManagerVM SaveFileDialog.Directory = m_CurrProject.Name SaveFileDialog.Extension = DDF_EXTENSION ' Se annullo esco - If Not SaveFileDialogWnd.ShowDialog Then Return + If Not SaveFileDialogWnd.ShowDialog Then + 'm_CurrProject.SelAssemblyName = New AssemblyName + m_CurrProject.SelAssemblyName = Nothing + Return + End If Dim FilePath As String = Path.GetFileNameWithoutExtension(SaveFileDialog.FileName) SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(FilePath, Trim(FilePath)) ' Controllo se il nome della porta ha estensione diff --git a/ProjectManager/Project.vb b/ProjectManager/Project.vb index 79cd767..920e34c 100644 --- a/ProjectManager/Project.vb +++ b/ProjectManager/Project.vb @@ -33,7 +33,10 @@ Public Class Project Return m_SelAssemblyName End Get Set(value As AssemblyName) - If IsNothing(value) then Return + If IsNothing(value) then + m_SelAssemblyName = value + Return + End If m_SelAssemblyName = value Map.refAssemblyManagerVM.Open(m_SelAssemblyName) NotifyPropertyChanged("Name") diff --git a/ProjectManager/ProjectManagerVM.vb b/ProjectManager/ProjectManagerVM.vb index b24ba99..9dc167d 100644 --- a/ProjectManager/ProjectManagerVM.vb +++ b/ProjectManager/ProjectManagerVM.vb @@ -235,14 +235,6 @@ Public Class ProjectManagerVM Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog) SaveFileDialog.Title = EgtMsg(50304) SaveFileDialog.Directory = IniFile.m_MyProjectDir - ' carico l'indirizzo dell'ultimo direttorio aperto, altrimenti mantegno quello delle impostazioni - If File.Exists(OptionModule.m_sLastProject) Then - SaveFileDialog.Directory = Path.GetDirectoryName(OptionModule.m_sLastProject) - ElseIf Path.HasExtension(OptionModule.m_sLastProject) AndAlso Directory.Exists(Path.GetDirectoryName(OptionModule.m_sLastProject)) Then - SaveFileDialog.Directory = Path.GetDirectoryName(OptionModule.m_sLastProject) - ElseIf Not Path.HasExtension(OptionModule.m_sLastProject) AndAlso Directory.Exists(OptionModule.m_sLastProject) Then - SaveFileDialog.Directory = OptionModule.m_sLastProject - End If SaveFileDialog.Extension = "\" ' se annullo la creazione di un nuovo direttorio, rimango in quello attuale (verifico che l'ultimo file non sia già in lettura) If Not SaveFileDialogWnd.ShowDialog Then @@ -486,6 +478,9 @@ Public Class ProjectManagerVM If Directory.Exists(sFilePath) AndAlso bIsSingleDoor Then m_MruFiles.Remove(sFilePath) bValidPath = False + ElseIf Directory.Exists(sFilePath) AndAlso Not bIsSingleDoor Then + sFilePathComplete = sFilePath + bValidPath = true ElseIf File.Exists(sFilePath) Then sFilePathComplete = sFilePath sFilePath = Path.GetDirectoryName(sFilePath) @@ -617,6 +612,7 @@ Public Class ProjectManagerVM ' SELEZIONE FILE DA ELENCO ' Notifico aggiornamento DoorList per aggiornare la grafica CurrProject.NotifyPropertyChanged("AssemblyList") + Utility.UnLockDir() ' Se c'è almeno una porta la visualizzo If CurrProject.AssemblyList.Count > 0 Then Dim bAssemblyIsSelected As Boolean = False @@ -650,10 +646,11 @@ Public Class ProjectManagerVM EgtZoom(ZM.ALL) End If - Utility.OutLog("Apertura file : " & CurrProject.SelAssemblyName.Name) ' carico il nome del direttorio e la visbilità della lista delle porte If bIsSingleDoor Then - Map.refMainWindowVM.ProjectNameMsg = CurrProject.SelAssemblyName.Name + If Not IsNothing(CurrProject.SelAssemblyName.Name) then + Map.refMainWindowVM.ProjectNameMsg = CurrProject.SelAssemblyName.Name + End If Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed Else Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name @@ -732,7 +729,7 @@ Public Class ProjectManagerVM Public Sub Save() ' Verifico esista elemento selezionato - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then + If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name) Then ' Impossibile savare un file se non esiste una porta! Errore MessageBox.Show(EgtMsg(50128), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation) Return @@ -916,6 +913,7 @@ Public Class ProjectManagerVM End If Else Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected + Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed End If End Sub