EgtDOORCreator 1.9j3 :
- gestione creazione/apertura singola porta.
This commit is contained in:
@@ -17,6 +17,16 @@ Public Class AssemblyManagerVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_VisibilityDoorList As Visibility = Visibility.Visible
|
||||
Public Property VisibilityDoorList As Visibility
|
||||
Get
|
||||
Return m_VisibilityDoorList
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_VisibilityDoorList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property AddNewDoorToolTip As String
|
||||
@@ -98,6 +108,8 @@ Public Class AssemblyManagerVM
|
||||
End If
|
||||
If DdfFile.DDFIsCorrect Then
|
||||
SavedAssName.IsModified = False
|
||||
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
|
||||
SavedAssName.NotifyPropertyChanged("IsModify")
|
||||
End If
|
||||
|
||||
@@ -142,6 +154,14 @@ Public Class AssemblyManagerVM
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
End If
|
||||
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
|
||||
' controllo che esiste almeno un file aperto
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name) Then
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
|
||||
Else
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -749,7 +769,6 @@ Public Class AssemblyManagerVM
|
||||
End If
|
||||
' elimino dalla lista
|
||||
m_CurrProject.AssemblyList.RemoveAt(IndexDoorList)
|
||||
' ''CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
End If
|
||||
' aggiungo il nome del file alla lista degli assemblati
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
@@ -758,7 +777,6 @@ Public Class AssemblyManagerVM
|
||||
' Seleziono AssembyName creato
|
||||
m_CurrProject.SelAssemblyName = Local_AssemblyName
|
||||
' aggiorno la lista
|
||||
''CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' LETTURA DI UN FILE DI TIPO TEMPLATE
|
||||
If Not String.IsNullOrEmpty(ImportTemplate) Then
|
||||
|
||||
@@ -27,6 +27,12 @@ Public Class AssemblyName
|
||||
Else
|
||||
m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
|
||||
End If
|
||||
If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = m_Name
|
||||
If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
End If
|
||||
NotifyPropertyChanged("GraphicName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -15,10 +15,13 @@ Public Class CompoType
|
||||
|
||||
' Folder Frame
|
||||
Private m_FrameFolderList As New ObservableCollection(Of CompoBrandDir)
|
||||
Public ReadOnly Property FrameFolderList As ObservableCollection(Of CompoBrandDir)
|
||||
Public Property FrameFolderList As ObservableCollection(Of CompoBrandDir)
|
||||
Get
|
||||
Return m_FrameFolderList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of CompoBrandDir))
|
||||
m_FrameFolderList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Folder Hardware
|
||||
|
||||
@@ -33,6 +33,7 @@ Module ConstIni
|
||||
Public Const K_DISABLEPROPERTIES As String = "DisableProperties"
|
||||
Public Const K_DISABLEADDGEOMETRY As String = "DisableAddGeometry"
|
||||
Public Const K_DISABLEARCH As String = "DisableArch"
|
||||
Public Const K_SINGLEDOOR As String = "SingleDoor"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
@@ -7,7 +7,16 @@ Public Class ProjectVisibilityConverter
|
||||
'Dim Local_Project As New Project
|
||||
'Local_Project = DirectCast(value, Project)
|
||||
Dim sProjectName As String = CStr(value)
|
||||
Return If(Directory.Exists(sProjectName), Visibility.Visible, Visibility.Collapsed)
|
||||
Dim VisibilityDoorList As Visibility = Visibility.Visible
|
||||
If Not IsNothing(Map.refAssemblyManagerVM) AndAlso Map.refAssemblyManagerVM.VisibilityDoorList <> Visibility.Visible Then
|
||||
Return Visibility.Collapsed
|
||||
End If
|
||||
If Directory.Exists(sProjectName) Then
|
||||
VisibilityDoorList = Visibility.Visible
|
||||
Else
|
||||
VisibilityDoorList = Visibility.Collapsed
|
||||
End If
|
||||
Return VisibilityDoorList
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
|
||||
@@ -965,7 +965,7 @@ Public Class Hardware
|
||||
Next
|
||||
End If
|
||||
|
||||
' se l'associazione è andata a buon fine allora esco, altimenti continuo
|
||||
' se l'associazione è andata a buon fine allora esco, altrimenti continuo
|
||||
If Not IsNothing(ComboBoxMatch.SelItem) Then Exit For
|
||||
|
||||
' "Automatic"
|
||||
@@ -1313,6 +1313,9 @@ Public Class Hardware
|
||||
For IndexHardw As Integer = 0 To Map.refCompoPanelVM.CompoTypeList.Count - 1
|
||||
If m_HardwareGeneral.DDFName = Map.refCompoPanelVM.CompoTypeList(IndexHardw).DDFName Then
|
||||
Map.refCompoPanelVM.CompoTypeList(IndexHardw).LoadListTemplate()
|
||||
If Map.refCompoPanelVM.CompoTypeList(IndexHardw).FrameFolderList.Count <> m_HardwareGeneral.FrameFolderList.Count Then
|
||||
m_HardwareGeneral.FrameFolderList = Map.refCompoPanelVM.CompoTypeList(IndexHardw).FrameFolderList
|
||||
End If
|
||||
Return True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.9.10.2")>
|
||||
<Assembly: AssemblyFileVersion("1.9.10.2")>
|
||||
<Assembly: AssemblyVersion("1.9.10.3")>
|
||||
<Assembly: AssemblyFileVersion("1.9.10.3")>
|
||||
|
||||
@@ -134,7 +134,7 @@ Public Class NewHardwareVM
|
||||
End While
|
||||
SelBrand = m_BrandList(SelItemindex)
|
||||
Template = "File Name"
|
||||
If Map.refHardwarePageVM.CurrHardware.TypeList.Count > 0 Then
|
||||
If Map.refHardwarePageVM.CurrHardware.TypeList.Count > 1 Then
|
||||
TypeVisibility = Visibility.Visible
|
||||
m_TypeList = Map.refHardwarePageVM.CurrHardware.TypeList
|
||||
NotifyPropertyChanged("TypeList")
|
||||
|
||||
@@ -84,6 +84,7 @@ Friend Module OptionModule
|
||||
|
||||
Friend m_DisableWindowOrder As Boolean
|
||||
Friend m_DisableTemplate As Boolean
|
||||
Friend m_SingleDoor As Boolean
|
||||
|
||||
Friend m_Disposition As New EdgeType(ConstGen.BEVEL_BYSWING, Visibility.Visible)
|
||||
Friend m_sDisposition As String = ConstGen.BEVEL_BYSWING
|
||||
@@ -241,6 +242,8 @@ Friend Module OptionModule
|
||||
|
||||
m_DisableArch = If(GetMainPrivateProfileInt(S_GENERAL, K_DISABLEARCH, 1) = 0, Visibility.Visible, Visibility.Collapsed)
|
||||
|
||||
m_SingleDoor = If(GetMainPrivateProfileInt(S_GENERAL, K_SINGLEDOOR, 0) = 1, True, False)
|
||||
|
||||
' leggo il tipo di Bevel selezionato
|
||||
DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELU_INI, m_bBevelUp)
|
||||
DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELD_INI, m_bBevelDown)
|
||||
|
||||
@@ -183,7 +183,7 @@ Public Class ProjectManagerHardwareVM
|
||||
If Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then
|
||||
Dim refNewHardwareV As New NewHardwareV
|
||||
Dim refNewhardwareVM As New NewHardwareVM(Map.refHardwarePageVM.CurrHardware.HardwareGeneral, NewHardwareVM.CommandList.nNew)
|
||||
refNewhardwareVM.TypeVisibility = Map.refHardwarePageVM.CurrHardware.VisibilityType
|
||||
' refNewhardwareVM.TypeVisibility = Map.refHardwarePageVM.CurrHardware.VisibilityType
|
||||
refNewHardwareV.DataContext = refNewhardwareVM
|
||||
refNewHardwareV.Owner = Application.Current.MainWindow
|
||||
refNewHardwareV.ShowDialog()
|
||||
@@ -479,6 +479,8 @@ Public Class ProjectManagerHardwareVM
|
||||
Map.refCompoPanelHardwareVM.CompoTypeList(IndexCompoType).IsSelectedBtn = False
|
||||
Next
|
||||
Map.refHardwarePageVM.CompoPanelControl.DataContext = Map.refCompoPanelHardwareVM
|
||||
' apro l'ultimo progetto
|
||||
LauncherModule.InitLauncherModule()
|
||||
Map.refProjectManagerVM.OpenLastProject()
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
CompoMatch.ResetSTU()
|
||||
|
||||
@@ -175,42 +175,81 @@ Public Class ProjectManagerVM
|
||||
' Gestisco porta corrente modificata
|
||||
If Not Map.refAssemblyManagerVM.ManageModified() Then Return
|
||||
' Richiedo il nome del progetto (cioè la directory da creare)
|
||||
If Not OptionModule.m_SingleDoor Then
|
||||
Dim SaveFileDialog As New MySaveFileDialogVM
|
||||
Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog)
|
||||
SaveFileDialog.Title = EgtMsg(50304)
|
||||
SaveFileDialog.Directory = IniFile.m_MyProjectDir & "\"
|
||||
SaveFileDialog.Extension = "\"
|
||||
If Not SaveFileDialogWnd.ShowDialog Then
|
||||
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
|
||||
Return
|
||||
End If
|
||||
' controllo che il direttorio non esista
|
||||
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
|
||||
If Directory.Exists(SaveFileDialog.FileName) Then
|
||||
MsgResult = MessageBox.Show("Directory " & SaveFileDialog.FileName & " already exists! Do you want to overwrite it?", "Caution", MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
|
||||
' cancello il direttorio
|
||||
Directory.Delete(SaveFileDialog.FileName, True)
|
||||
End If
|
||||
If MsgResult = MessageBoxResult.No Then
|
||||
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
|
||||
Return
|
||||
End If
|
||||
' Creo nuovo progetto
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Creo nuova porta
|
||||
Map.refAssemblyManagerVM.AddAssembly()
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim SaveFileDialog As New MySaveFileDialogVM
|
||||
Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog)
|
||||
SaveFileDialog.Title = EgtMsg(50304)
|
||||
SaveFileDialog.Directory = IniFile.m_MyProjectDir & "\"
|
||||
SaveFileDialog.Extension = "\"
|
||||
If Not SaveFileDialogWnd.ShowDialog Then
|
||||
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
|
||||
Return
|
||||
' dichiaro la finestra di dialogo
|
||||
Dim saveFileDialog1 As New System.Windows.Forms.SaveFileDialog()
|
||||
saveFileDialog1.Filter = "ddf files (*.ddf)|*.ddf"
|
||||
saveFileDialog1.FilterIndex = 2
|
||||
saveFileDialog1.RestoreDirectory = True
|
||||
' apro la finestra di dialogo
|
||||
If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
|
||||
Dim FilePathComplete As String = saveFileDialog1.FileName
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
CurrProject.Name = Path.GetDirectoryName(FilePathComplete)
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' creo un nuovo assemblato
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = FilePathComplete
|
||||
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' Seleziono AssembyName creato
|
||||
m_CurrProject.SelAssemblyName = Local_AssemblyName
|
||||
' Creo nuovo assembly
|
||||
Map.refAssemblyManagerVM.NewCmd(Local_AssemblyName)
|
||||
' carico il nome come Assemblato selezionato
|
||||
If Not OptionModule.m_DisableWindowOrder Then
|
||||
Dim OrderWindow As New OrderV(Application.Current.MainWindow, New OrderVM())
|
||||
OrderWindow.ShowDialog()
|
||||
End If
|
||||
' tolgo la visualizzazione della lista dei nomi
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
End If
|
||||
' controllo che il direttorio non esista
|
||||
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
|
||||
If Directory.Exists(SaveFileDialog.FileName) Then
|
||||
MsgResult = MessageBox.Show("Directory " & SaveFileDialog.FileName & " already exists! Do you want to overwrite it?", "Caution", MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
|
||||
' cancello il direttorio
|
||||
Directory.Delete(SaveFileDialog.FileName, True)
|
||||
End If
|
||||
If MsgResult = MessageBoxResult.No Then
|
||||
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
|
||||
Return
|
||||
End If
|
||||
' Creo nuovo progetto
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Creo nuova porta
|
||||
Map.refAssemblyManagerVM.AddAssembly()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' NewCommand
|
||||
@@ -226,14 +265,14 @@ Public Class ProjectManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Public Sub Open()
|
||||
OpenProject("")
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProject(sFilePath As String)
|
||||
' se true carica una singola porta del progetto
|
||||
Dim bModifiersShift As Boolean = OptionModule.m_SingleDoor
|
||||
Dim sFilePathComplete As String = String.Empty
|
||||
' 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))
|
||||
@@ -250,22 +289,53 @@ Public Class ProjectManagerVM
|
||||
If String.IsNullOrWhiteSpace(sFilePath) OrElse Not Directory.Exists(sFilePath) Then
|
||||
' elimino eventual FilePath inesistente dalla lista dei recenti
|
||||
m_MruFiles.Remove(sFilePath)
|
||||
' apro finestra di scelta cartella di progetto
|
||||
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
|
||||
If Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||
FolderBrowserDialog.SelectedPath = Map.refAssemblyManagerVM.CurrProject.Name
|
||||
ElseIf Not String.IsNullOrEmpty(OptionModule.m_sLastProject) Then
|
||||
FolderBrowserDialog.SelectedPath = Path.GetDirectoryName(OptionModule.m_sLastProject)
|
||||
|
||||
'If OptionModule.m_SingleDoor OrElse Keyboard.Modifiers.HasFlag(ModifierKeys.Shift) Then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
bModifiersShift = 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"
|
||||
' indirizzo la scelta verso una cartella
|
||||
If Not String.IsNullOrEmpty(OptionModule.m_sLastProject) Then
|
||||
fd.InitialDirectory = Path.GetDirectoryName(OptionModule.m_sLastProject)
|
||||
ElseIf Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||
fd.InitialDirectory = Map.refAssemblyManagerVM.CurrProject.Name
|
||||
Else
|
||||
fd.InitialDirectory = IniFile.m_MyProjectDir
|
||||
End If
|
||||
' seleziono il filtro di apertura
|
||||
fd.Filter = " (*.ddf)|*.ddf|(*.ddf)|*.ddf"
|
||||
fd.FilterIndex = 2
|
||||
fd.RestoreDirectory = True
|
||||
' apro la finestra di dialogo
|
||||
If fd.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
|
||||
Return
|
||||
End If
|
||||
' salvo il nome del direttorio
|
||||
sFilePath = Path.GetDirectoryName(fd.FileName)
|
||||
' salvo il nome completo del file
|
||||
sFilePathComplete = fd.FileName
|
||||
Else
|
||||
FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir
|
||||
' dichiaro la finestra di scelta cartella di progetto
|
||||
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
|
||||
If Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||
FolderBrowserDialog.SelectedPath = Map.refAssemblyManagerVM.CurrProject.Name
|
||||
ElseIf Not String.IsNullOrEmpty(OptionModule.m_sLastProject) Then
|
||||
FolderBrowserDialog.SelectedPath = Path.GetDirectoryName(OptionModule.m_sLastProject)
|
||||
Else
|
||||
FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir
|
||||
End If
|
||||
' mostriamo la finestra di dialogo aperta nel direttorio selzionato sopra
|
||||
If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then
|
||||
' se la risposta è diversa da OK esce
|
||||
Return
|
||||
End If
|
||||
' salvo il nome del direttorio
|
||||
sFilePath = FolderBrowserDialog.SelectedPath
|
||||
End If
|
||||
' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
|
||||
If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then
|
||||
' se la risposta è diversa da OK esce
|
||||
Return
|
||||
End If
|
||||
sFilePath = FolderBrowserDialog.SelectedPath
|
||||
End If
|
||||
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
@@ -273,33 +343,59 @@ Public Class ProjectManagerVM
|
||||
CurrProject.Name = sFilePath
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
' 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)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
' lo aggiungo alla lista delle porte
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
End If
|
||||
Next
|
||||
|
||||
' caricamento elenco porte
|
||||
If Not bModifiersShift 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)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
' lo aggiungo alla lista delle porte
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
' carcio la singola porta
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = sFilePathComplete
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
End If
|
||||
|
||||
' Notifico aggiornamento DoorList e Name per aggiornare la grafica
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
'CurrProject.NotifyPropertyChanged("Name")
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
' Se c'è almeno una porta la visualizzo
|
||||
If CurrProject.AssemblyList.Count > 0 Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(0)
|
||||
'Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(0))
|
||||
Else
|
||||
Map.refPartPageVM.CurrPart = Nothing
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Aggiungo alla lista dei recenti
|
||||
' carico il nome del direttorio e la visbilità della lista delle porte
|
||||
If bModifiersShift Then
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.SelAssemblyName.Name
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
|
||||
Else
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la grafica
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
' salvo il nome del file corrente in lettura
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name) Then
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
|
||||
Else
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
End If
|
||||
' Aggiungo alla lista dei recenti/ verifico se esite anche se posso salvare un indirizzo comlpeto
|
||||
m_MruFiles.Add(sFilePath)
|
||||
End Sub
|
||||
|
||||
@@ -381,13 +477,15 @@ Public Class ProjectManagerVM
|
||||
End Property
|
||||
|
||||
Public Sub OpenLastProject()
|
||||
' Apro l'ultimo progetto
|
||||
Dim CurrName As String = String.Empty
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name) Then
|
||||
CurrName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
End If
|
||||
End If
|
||||
'' Apro l'ultimo progetto
|
||||
'Dim CurrName As String = String.Empty
|
||||
'' verifico se esiste una precedente selezione
|
||||
'If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
' If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name) Then
|
||||
' CurrName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
' End If
|
||||
'End If
|
||||
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' carico il percorso dell'ultimo progetto salvato (sul file Config.ini)
|
||||
If IsNothing(CurrProject.Name) Then
|
||||
@@ -404,51 +502,84 @@ Public Class ProjectManagerVM
|
||||
CurrProject.AssemblyList.Clear()
|
||||
' verifico che esista la cartella
|
||||
If Directory.Exists(CurrProject.Name) Then
|
||||
' Aggiungo porte trovate nella cartella ad un vettore
|
||||
Dim DDFFileArray() As String = Directory.GetFiles(CurrProject.Name)
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
' lo aggiungo alla lista delle porte
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
' carico la singola porta dell'ultimo progetto come unica porta
|
||||
If OptionModule.m_SingleDoor Then
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
If File.Exists(OptionModule.m_sLastProject) Then
|
||||
Local_Assembly.Name = OptionModule.m_sLastProject
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
Else
|
||||
' Aggiungo il primo nome all'elenco
|
||||
Dim DDFFileArray() As String = Directory.GetFiles(CurrProject.Name)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
OptionModule.m_sLastProject = DDFFileArray(DDFIndex)
|
||||
Local_Assembly.Name = OptionModule.m_sLastProject
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
|
||||
Else
|
||||
' carico un vettore con i file della cartella
|
||||
Dim DDFFileArray() As String = Directory.GetFiles(CurrProject.Name)
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
' lo aggiungo alla lista delle porte
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
Local_Assembly.IsModified = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
End If
|
||||
Next
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
End If
|
||||
|
||||
' Notifico aggiornamento DoorList e Name per aggiornare la grafica
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
'Map.refMainWindowVM.ModifyTitle(False)
|
||||
|
||||
' Se c'è almeno una porta la visualizzo
|
||||
If CurrProject.AssemblyList.Count > 0 Then
|
||||
If Not IsNothing(CurrName) Then
|
||||
For IndexListAss As Integer = 0 To CurrProject.AssemblyList.Count - 1
|
||||
If CurrName = CurrProject.AssemblyList(IndexListAss).Name Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(IndexListAss)
|
||||
'Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(IndexListAss))
|
||||
'If Not String.IsNullOrEmpty(CurrName) Then
|
||||
' ' ricerco nell'elenco la porta salvata
|
||||
' For IndexListAss As Integer = 0 To CurrProject.AssemblyList.Count - 1
|
||||
' If CurrName = CurrProject.AssemblyList(IndexListAss).Name Then
|
||||
' CurrProject.SelAssemblyName = CurrProject.AssemblyList(IndexListAss)
|
||||
' Return
|
||||
' End If
|
||||
' Next
|
||||
'End If
|
||||
|
||||
' provo a caricare l'ultimo file aperto
|
||||
If File.Exists(OptionModule.m_sLastProject) Then
|
||||
For Each ItemFile In CurrProject.AssemblyList
|
||||
If ItemFile.Name = OptionModule.m_sLastProject Then
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
If OptionModule.m_SingleDoor Then Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(CurrName) AndAlso File.Exists(OptionModule.m_sLastProject) Then
|
||||
For Each ItemFile In CurrProject.AssemblyList
|
||||
If ItemFile.Name = OptionModule.m_sLastProject Then
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
' se non esiste il file allora provo a caricare il primo della lista
|
||||
If File.Exists(CurrProject.AssemblyList(0).Name) Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(0)
|
||||
If OptionModule.m_SingleDoor Then Map.refMainWindowVM.ProjectNameMsg = CurrProject.AssemblyList(0).Name
|
||||
Else
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
End If
|
||||
|
||||
Else
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
End If
|
||||
Else
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user