diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb
index 3a6e146..6a2d4d2 100644
--- a/MainWindow/MainWindowVM.vb
+++ b/MainWindow/MainWindowVM.vb
@@ -372,7 +372,7 @@ Public Class MainWindowVM
EgtOutLog("Error in EgtLoadMessages")
End If
' Leggo e imposto livello utilizzatore
- m_nUserLevel = Math.Min(m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
+ IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' imposto dir font Nfe e font default
Dim sNfeDir As String = String.Empty
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
diff --git a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb
index 3f18cb5..59ad21b 100644
--- a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb
+++ b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb
@@ -646,7 +646,7 @@ Public Class ManageLayerExpanderVM
End If
End If
' per visualizzare oggetti di livello diverso da utente o di modo diverso da standard, si deve avere il permesso
- If (nLevel <> GDB_LV.USER Or nMode <> GDB_MD.STD) And m_nUserLevel < 5 Then
+ If (nLevel <> GDB_LV.USER Or nMode <> GDB_MD.STD) And IniFile.m_nUserLevel < 5 Then
Return
End If
' inserisco il nodo nell'albero
diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb
index b111c50..070aaa9 100644
--- a/Project/ProjectVM.vb
+++ b/Project/ProjectVM.vb
@@ -90,95 +90,95 @@ Public Class ProjectVM
#Region "LoadedCommand"
- '''
- ''' Returns a command that do Point.
- '''
- Public ReadOnly Property LoadedCommand As ICommand
- Get
- If m_cmdLoaded Is Nothing Then
- m_cmdLoaded = New RelayCommand(AddressOf Loaded)
- End If
- Return m_cmdLoaded
- End Get
- End Property
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property LoadedCommand As ICommand
+ Get
+ If m_cmdLoaded Is Nothing Then
+ m_cmdLoaded = New RelayCommand(AddressOf Loaded)
+ End If
+ Return m_cmdLoaded
+ End Get
+ End Property
- '''
- ''' Execute the Point. This method is invoked by the PointCommand.
- '''
- Public Sub Loaded(ByVal param As Object)
- ' Verifico sia la prima volta
- If m_bLoaded Then Return
- m_bLoaded = True
- ' Creazione scena
- PreInitializeScene()
- ' Se tutto bene
- If m_ProjectScene.Init() And (IniFile.m_nKeyOptions And KEY_OPT.BASE) <> 0 Then
- IniFile.m_ProjectSceneContext = m_ProjectScene.GetCtx
- PostInitializeScene()
- ' Recupero e imposto handle finestra principale
- Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
- EgtSetMainWindowHandle(hMainWnd)
- ' Inizializzo gestore lavorazioni
- If Not EgtInitMachMgr(IniFile.m_sMachinesRoot, IniFile.m_sToolMakersDir) Then
- ' non riuscita -> imposto modalità solo disegno
- IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW
- Map.refProjectV.SetDbPanelVisibility()
- End If
- ' Inizializzo gestore travi e pareti
- If ( IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 Or ( IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0 Then
- Dim nFlag As Integer = GetPrivateProfileInt( S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
- EgtInitBeamMgr( nFlag)
- End If
- ' Apro progetto vuoto
- Map.refTopCommandBarVM.NewCmd()
- ' Seleziono la macchina impostata nel file ini
- Map.refMachinePanelVM.LoadCurrentMachine()
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- Return
- End If
- ' Problemi
- SceneHost.Child = Nothing
- ' Se manca la chiave
- If IniFile.m_nKeyLevel = -1 Or IniFile.m_nKeyLevel = -2 Then
- EgtOutLog("Missing Dongle")
- ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
- Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
- Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
- MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
- ' Altrimenti manca la licenza
- Else
- EgtOutLog("Problems with Licence")
- ' Box di avviso licenza con problemi : sKeyInfo \n "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
- Dim sKeyInfo As String = "" : EgtGetKeyInfo(sKeyInfo)
- Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
- Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
- If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
- ' Apro dialogo per richiesta file licenza
- Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub Loaded(ByVal param As Object)
+ ' Verifico sia la prima volta
+ If m_bLoaded Then Return
+ m_bLoaded = True
+ ' Creazione scena
+ PreInitializeScene()
+ ' Se tutto bene
+ If m_ProjectScene.Init() And (IniFile.m_nKeyOptions And KEY_OPT.BASE) <> 0 Then
+ IniFile.m_ProjectSceneContext = m_ProjectScene.GetCtx
+ PostInitializeScene()
+ ' Recupero e imposto handle finestra principale
+ Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
+ EgtSetMainWindowHandle(hMainWnd)
+ ' Inizializzo gestore lavorazioni
+ If Not EgtInitMachMgr(IniFile.m_sMachinesRoot, IniFile.m_sToolMakersDir) Then
+ ' non riuscita -> imposto modalità solo disegno
+ IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW
+ Map.refProjectV.SetDbPanelVisibility()
+ End If
+ ' Inizializzo gestore travi e pareti
+ If ( IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 Or ( IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0 Then
+ Dim nFlag As Integer = GetPrivateProfileInt( S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
+ EgtInitBeamMgr( nFlag)
+ End If
+ ' Apro progetto vuoto
+ Map.refTopCommandBarVM.NewCmd()
+ ' Seleziono la macchina impostata nel file ini
+ Map.refMachinePanelVM.LoadCurrentMachine()
+ EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
+ Return
+ End If
+ ' Problemi
+ SceneHost.Child = Nothing
+ ' Se manca la chiave
+ If IniFile.m_nKeyLevel = -1 Or IniFile.m_nKeyLevel = -2 Then
+ EgtOutLog("Missing Dongle")
+ ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
+ Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
+ Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
+ MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
+ ' Altrimenti manca la licenza
+ Else
+ EgtOutLog("Problems with Licence")
+ ' Box di avviso licenza con problemi : sKeyInfo \n "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
+ Dim sKeyInfo As String = "" : EgtGetKeyInfo(sKeyInfo)
+ Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
+ Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
+ If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
+ ' Apro dialogo per richiesta file licenza
+ Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".lic",
.Filter = "Licences (.lic)|*.lic",
.CheckFileExists = True,
.ValidateNames = True
}
- If LicDlg.ShowDialog() = True Then
- ' Recupero il direttorio del file
- Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
- ' Se il file non è già nel direttorio di configurazione lo copio
- If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(IniFile.m_sConfigDir), StringComparison.OrdinalIgnoreCase) Then
- Try
- File.Copy(LicDlg.FileName, Path.Combine(IniFile.m_sConfigDir, LicDlg.SafeFileName), True)
- Catch ex As Exception
- End Try
- End If
- ' Imposto il nuovo file di licenza nell'Ini
- WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
- End If
+ If LicDlg.ShowDialog() = True Then
+ ' Recupero il direttorio del file
+ Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
+ ' Se il file non è già nel direttorio di configurazione lo copio
+ If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(IniFile.m_sConfigDir), StringComparison.OrdinalIgnoreCase) Then
+ Try
+ File.Copy(LicDlg.FileName, Path.Combine(IniFile.m_sConfigDir, LicDlg.SafeFileName), True)
+ Catch ex As Exception
+ End Try
End If
- End If
- ' Chiudo il programma
- IniFile.m_bFailedRun = True
- Map.refMainWindowVM.CloseApplicationCmd()
- End Sub
+ ' Imposto il nuovo file di licenza nell'Ini
+ WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
+ End If
+ End If
+ End If
+ ' Chiudo il programma
+ IniFile.m_bFailedRun = True
+ Map.refMainWindowVM.CloseApplicationCmd()
+ End Sub
#End Region ' LoadedCommand
@@ -228,6 +228,7 @@ Public Class ProjectVM
Private Sub PostInitializeScene()
' Impostazioni Controller
+ m_Controller.SetUserLevel( IniFile.m_nUserLevel)
m_Controller.SetScene(m_ProjectScene)
Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0) <> 0)
Dim sCmdLogFile As String = CMDLOG_FILE_NAME.Replace("#", IniFile.m_nInstance.ToString())