refresh from EgtDev
This commit is contained in:
@@ -99,21 +99,18 @@ Public Class OpenProjectFileDialogVM
|
||||
Public Function Init(ProjectType As ProjectType, Optional ProjectList As List(Of ProjectFile) = Nothing) As Boolean?
|
||||
m_ProjectType = ProjectType
|
||||
If IsNothing(ProjectList) OrElse ProjectList.Count = 0 Then
|
||||
' leggo lista proj da DB
|
||||
Dim ProjController As New DataLayer.Controllers.ProjController
|
||||
Dim ProjList As List(Of DataLayer.DatabaseModels.ProjModel) = ProjController.GetLastPaginatedDesc(50)
|
||||
'' cartella da cui leggere i programmi
|
||||
'Dim sFolderPath As String
|
||||
'If m_ProjectType = ProjectType.PROJ Then
|
||||
' sFolderPath = Map.refMainWindowVM.MainWindowM.sProjsDir
|
||||
'Else
|
||||
' sFolderPath = Map.refMainWindowVM.MainWindowM.sProdsDir
|
||||
'End If
|
||||
'' leggo i file che contiene
|
||||
'Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(sFolderPath)
|
||||
'For Each CurrDirectory In AllDirsInDir
|
||||
' VerifyFiles(CurrDirectory)
|
||||
'Next
|
||||
' cartella da cui leggere i programmi
|
||||
Dim sFolderPath As String
|
||||
If m_ProjectType = ProjectType.PROJ Then
|
||||
sFolderPath = Map.refMainWindowVM.MainWindowM.sProjsDir
|
||||
Else
|
||||
sFolderPath = Map.refMainWindowVM.MainWindowM.sProdsDir
|
||||
End If
|
||||
' leggo i file che contiene
|
||||
Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(sFolderPath)
|
||||
For Each CurrDirectory In AllDirsInDir
|
||||
VerifyFiles(CurrDirectory)
|
||||
Next
|
||||
Else
|
||||
m_ProjectList = ProjectList
|
||||
End If
|
||||
@@ -133,20 +130,6 @@ Public Class OpenProjectFileDialogVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub VerifyFiles(FileId As String)
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(CurrDirectory)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
Dim nProjId As Integer = 0
|
||||
Dim nProdId As Integer = 0
|
||||
Dim sBTLFileName As String = ""
|
||||
If ProjectFile.VerifyProjectFile(m_ProjectType, Path.GetFileNameWithoutExtension(File), nProjId, nProdId, sBTLFileName) Then
|
||||
m_ProjectList.Add(New ProjectFile(m_ProjectType, nProjId, nProdId, sBTLFileName))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Function VerifySelected() As Boolean
|
||||
Return Not IsNothing(SelProject)
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user