Effector.Main 3.1.5.2:
- aggiunta lettura file di messaggi del plugin
This commit is contained in:
@@ -192,7 +192,7 @@ Public Class MainWindowM
|
||||
'If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
|
||||
' sMsgDir = m_sConfigDir
|
||||
'End If
|
||||
''' Inizializzo OptionModule
|
||||
'' Inizializzo OptionModule
|
||||
''OptionModule.InitOptionModule()
|
||||
' Leggo lingua corrente
|
||||
Dim sLanguage As String = String.Empty
|
||||
@@ -209,8 +209,38 @@ Public Class MainWindowM
|
||||
nIndex += 1
|
||||
ReadLanguage = GetMainPrivateProfileLanguage(S_LANGUAGES, nIndex)
|
||||
End While
|
||||
' Leggo file messaggi
|
||||
' recupero file messaggi
|
||||
Dim sMsgFilePath As String = m_sDataRoot & "\" & MSG_DIR & "\" & sMsgName
|
||||
' verifico se c'e' un plugin
|
||||
Dim sPluginName As String = ""
|
||||
If GetMainPrivateProfileString(S_GENERAL, K_PLUGINNAME, "", sPluginName) > 0 AndAlso Not String.IsNullOrWhiteSpace(sPluginName) Then
|
||||
' recupero nome del file messaggi del plugin
|
||||
Dim sPlugInMsgFilePath As String = m_sDataRoot & "\Plugin\" & sPluginName & "\Messages\" & sMsgName
|
||||
If File.Exists(sPlugInMsgFilePath) Then
|
||||
Dim OrigMsgFile As List(Of String) = File.ReadAllLines(sMsgFilePath).ToList()
|
||||
' elimino eventuali righe vuote o commento di fine
|
||||
While String.IsNullOrWhiteSpace(OrigMsgFile.Last()) OrElse OrigMsgFile.Last().StartsWith("//")
|
||||
OrigMsgFile.RemoveAt(OrigMsgFile.Count - 1)
|
||||
End While
|
||||
Dim PluginMsgFile As List(Of String) = File.ReadAllLines(sPlugInMsgFilePath).ToList()
|
||||
' elimino eventuale riga di inizio file
|
||||
If PluginMsgFile.Count > 1 AndAlso PluginMsgFile(1).StartsWith("//") AndAlso PluginMsgFile(0).StartsWith("//") Then
|
||||
PluginMsgFile.RemoveAt(0)
|
||||
End If
|
||||
OrigMsgFile.AddRange(PluginMsgFile)
|
||||
Dim sNewMsgFilePath As String = m_sDataRoot & "\Plugin\" & sPluginName & "\Messages\Complete" & sMsgName
|
||||
Dim bNewMsgFile As Boolean = False
|
||||
Try
|
||||
File.WriteAllLines(sNewMsgFilePath, OrigMsgFile)
|
||||
bNewMsgFile = True
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
If bNewMsgFile Then
|
||||
sMsgFilePath = sNewMsgFilePath
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Leggo file messaggi
|
||||
If Not EgtLoadMessages(sMsgFilePath) Then
|
||||
EgtOutLog("Error in EgtLoadMessages")
|
||||
End If
|
||||
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.1")>
|
||||
<Assembly: AssemblyVersion("3.1.5.2")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.2")>
|
||||
|
||||
Reference in New Issue
Block a user