EgtCAM5 :
- Correzzione EgtSaveFile Dialog. - Eliminazione Can da tutti i comandi dei bottoni nel programma.
This commit is contained in:
@@ -241,22 +241,23 @@ Namespace EgtCAM5
|
||||
|
||||
Private Sub SetActiveTable()
|
||||
Dim ActiveMTableName As String = String.Empty
|
||||
Dim ActiveMTableFilePath As String = Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\CurrMTable.lua"
|
||||
If File.Exists(ActiveMTableFilePath) Then
|
||||
Dim ReadFile As String() = File.ReadAllLines(ActiveMTableFilePath)
|
||||
For LineIndex As Integer = 0 To ReadFile.Count - 1
|
||||
If ReadFile(LineIndex).Contains(MTABLENAME) Then
|
||||
ActiveMTableName = TableUtility.SearchKey(ReadFile(LineIndex), MTNAME)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
For Index As Integer = 0 To m_TablesList.Count - 1
|
||||
If m_TablesList(Index).TableName = ActiveMTableName Then
|
||||
m_TablesList(Index).ActiveTable = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
GetPrivateProfileString(S_DOORS, K_CURRMTABLE, "", ActiveMTableName)
|
||||
'Dim ActiveMTableFilePath As String = Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\CurrMTable.lua"
|
||||
'If File.Exists(ActiveMTableFilePath) Then
|
||||
' Dim ReadFile As String() = File.ReadAllLines(ActiveMTableFilePath)
|
||||
' For LineIndex As Integer = 0 To ReadFile.Count - 1
|
||||
' If ReadFile(LineIndex).Contains(MTABLENAME) Then
|
||||
' ActiveMTableName = TableUtility.SearchKey(ReadFile(LineIndex), MTNAME)
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
For Index As Integer = 0 To m_TablesList.Count - 1
|
||||
If m_TablesList(Index).TableName = ActiveMTableName Then
|
||||
m_TablesList(Index).ActiveTable = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -368,7 +369,7 @@ Namespace EgtCAM5
|
||||
SaveFileDialogView.Extension = ".mtl"
|
||||
SaveFileDialogView.Directory = sDir
|
||||
SaveFileDialogView.FileName = sTableName
|
||||
If Not SaveFileDialogView.ShowDialog Then
|
||||
If Not SaveFileDialogView.EgtShowDialog Then
|
||||
Return False
|
||||
End If
|
||||
sPath = SaveFileDialogView.FileName
|
||||
@@ -445,23 +446,25 @@ Namespace EgtCAM5
|
||||
Public Sub SetActiveTable(param As Object)
|
||||
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
|
||||
If IsNothing(SelectedMTable) Then Return
|
||||
For Index As Integer = 0 To m_TablesList.Count - 1
|
||||
If m_TablesList(Index).TableName = SelectedMTable.TableName Then
|
||||
m_TablesList(Index).ActiveTable = True
|
||||
Else
|
||||
m_TablesList(Index).ActiveTable = False
|
||||
End If
|
||||
Next
|
||||
' Scrivo il file di configurazione con il nome di questa tavola
|
||||
Dim FileContent As String() = File.ReadAllLines(Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\" & CURRMTABLE_FILE)
|
||||
Dim NewTableFileContent As New List(Of String)
|
||||
For LineIndex As Integer = 0 To FileContent.Count - 1
|
||||
Dim sCurrLine As String = FileContent(LineIndex)
|
||||
sCurrLine = sCurrLine.Replace(TableUtility.DATETIME, System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"))
|
||||
sCurrLine = sCurrLine.Replace(TableUtility.TABLENAME, SelectedMTable.TableName)
|
||||
NewTableFileContent.Add(sCurrLine)
|
||||
Next
|
||||
File.WriteAllLines(Path.ChangeExtension(Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\" & CURRMTABLE_FILE, ".lua"), NewTableFileContent, Text.Encoding.UTF8)
|
||||
If WritePrivateProfileString(S_DOORS, K_CURRMTABLE, SelectedMTable.TableName) Then
|
||||
For Index As Integer = 0 To m_TablesList.Count - 1
|
||||
If m_TablesList(Index).TableName = SelectedMTable.TableName Then
|
||||
m_TablesList(Index).ActiveTable = True
|
||||
Else
|
||||
m_TablesList(Index).ActiveTable = False
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
'' Scrivo il file di configurazione con il nome di questa tavola
|
||||
'Dim FileContent As String() = File.ReadAllLines(Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\" & CURRMTABLE_FILE)
|
||||
'Dim NewTableFileContent As New List(Of String)
|
||||
'For LineIndex As Integer = 0 To FileContent.Count - 1
|
||||
' Dim sCurrLine As String = FileContent(LineIndex)
|
||||
' sCurrLine = sCurrLine.Replace(TableUtility.DATETIME, System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"))
|
||||
' sCurrLine = sCurrLine.Replace(TableUtility.TABLENAME, SelectedMTable.TableName)
|
||||
' NewTableFileContent.Add(sCurrLine)
|
||||
'Next
|
||||
'File.WriteAllLines(Path.ChangeExtension(Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\" & CURRMTABLE_FILE, ".lua"), NewTableFileContent, Text.Encoding.UTF8)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user