EgtDOORCreator 1.9k3 :
- aggiunta di nuovo parametro ( ActiveBox); - possibilità di selezionare l'ultimo ddf letto ( in modalità singola porta); - elimino l'errore dopo la modifica dei parametri; - porto il focus sul ddf selezionato ( in modalità progetto).
This commit is contained in:
@@ -273,8 +273,9 @@ Public Class ProjectManagerVM
|
||||
|
||||
Public Sub OpenProject(sFilePath As String)
|
||||
' se true carica una singola porta del progetto
|
||||
Dim bModifiersShift As Boolean = OptionModule.m_SingleDoor
|
||||
Dim bIsSingleDoor As Boolean = OptionModule.m_SingleDoor
|
||||
Dim sFilePathComplete As String = String.Empty
|
||||
Dim bValidPath As Boolean = False
|
||||
' verifico se selezionato esiste e modificato
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
||||
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
|
||||
@@ -287,14 +288,28 @@ Public Class ProjectManagerVM
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
' Se FilePath non valida
|
||||
If String.IsNullOrWhiteSpace(sFilePath) OrElse Not Directory.Exists(sFilePath) Then
|
||||
|
||||
If Directory.Exists(sFilePath) AndAlso Not bIsSingleDoor Then
|
||||
bValidPath = True
|
||||
ElseIf Directory.Exists(sFilePath) AndAlso bIsSingleDoor Then
|
||||
m_MruFiles.Remove(sFilePath)
|
||||
bValidPath = False
|
||||
ElseIf File.Exists(sFilePath) Then
|
||||
sFilePathComplete = sFilePath
|
||||
sFilePath = Path.GetDirectoryName(sFilePath)
|
||||
bValidPath = True
|
||||
Else
|
||||
' elimino eventual FilePath inesistente dalla lista dei recenti
|
||||
m_MruFiles.Remove(sFilePath)
|
||||
bValidPath = False
|
||||
End If
|
||||
|
||||
' Se FilePath non valida
|
||||
If Not bValidPath Then
|
||||
|
||||
'If OptionModule.m_SingleDoor OrElse Keyboard.Modifiers.HasFlag(ModifierKeys.Shift) Then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
bModifiersShift = True
|
||||
bIsSingleDoor = True
|
||||
' definisco la finestra di dialogo per la scelta dei file
|
||||
Dim fd As System.Windows.Forms.OpenFileDialog = New System.Windows.Forms.OpenFileDialog()
|
||||
fd.Title = "Open File Dialog"
|
||||
@@ -349,7 +364,7 @@ Public Class ProjectManagerVM
|
||||
CurrProject.AssemblyList.Clear()
|
||||
|
||||
' caricamento elenco porte
|
||||
If Not bModifiersShift Then
|
||||
If Not bIsSingleDoor Then
|
||||
' Aggiungo porte trovate nella cartella ad un vettore
|
||||
Dim DDFFileArray() As String = Directory.GetFiles(sFilePath)
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
@@ -375,7 +390,19 @@ Public Class ProjectManagerVM
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
' Se c'è almeno una porta la visualizzo
|
||||
If CurrProject.AssemblyList.Count > 0 Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(0)
|
||||
Dim bAssemblyIsSelected As Boolean = False
|
||||
If Not String.IsNullOrWhiteSpace(sFilePathComplete) Then
|
||||
For Each ItemFile In CurrProject.AssemblyList
|
||||
If sFilePathComplete = ItemFile.Name Then
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
bAssemblyIsSelected = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If Not bAssemblyIsSelected Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(0)
|
||||
End If
|
||||
Else
|
||||
Map.refPartPageVM.CurrPart = Nothing
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
@@ -383,7 +410,7 @@ Public Class ProjectManagerVM
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
' carico il nome del direttorio e la visbilità della lista delle porte
|
||||
If bModifiersShift Then
|
||||
If bIsSingleDoor Then
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.SelAssemblyName.Name
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
|
||||
Else
|
||||
@@ -401,7 +428,12 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
' Aggiungo alla lista dei recenti/ verifico se esite anche se posso salvare un indirizzo comlpeto
|
||||
Map.refOptionsVM.MyProjectDir = sFilePath
|
||||
m_MruFiles.Add(sFilePath)
|
||||
If bIsSingleDoor Then
|
||||
m_MruFiles.Add(CurrProject.SelAssemblyName.Name)
|
||||
Else
|
||||
m_MruFiles.Add(sFilePath)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCommand
|
||||
@@ -418,7 +450,8 @@ Public Class ProjectManagerVM
|
||||
End Property
|
||||
|
||||
Public Sub OpenMruFile(ByVal param As Object)
|
||||
OpenProject(DirectCast(param, String).Replace("__", "_"))
|
||||
Dim sLastProject As String = DirectCast(param, String).Replace("__", "_")
|
||||
OpenProject(sLastProject)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenMruFileCommand
|
||||
@@ -566,11 +599,13 @@ Public Class ProjectManagerVM
|
||||
' provo a caricare l'ultimo file aperto
|
||||
If File.Exists(OptionModule.m_sLastProject) Then
|
||||
For Each ItemFile In CurrProject.AssemblyList
|
||||
Dim Index As Integer = 1
|
||||
If ItemFile.Name = OptionModule.m_sLastProject Then
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
If OptionModule.m_SingleDoor Then Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Return
|
||||
End If
|
||||
Index = Index + 1
|
||||
Next
|
||||
End If
|
||||
' se non esiste il file allora provo a caricare il primo della lista
|
||||
|
||||
Reference in New Issue
Block a user