-aggiunto controllo tempo per apertura script

-pulizia codice
-aggiunto apertura più file lua
This commit is contained in:
Demetrio Cassarino
2025-03-03 10:00:50 +01:00
parent 305913a8a9
commit f3bd024f29
6 changed files with 125 additions and 188 deletions
+23 -6
View File
@@ -1,4 +1,6 @@
Public Class ScriptWindowV
Imports System.Windows.Threading
Public Class ScriptWindowV
#Region "CONSTRUCTOR"
@@ -22,11 +24,20 @@
End Sub
Private Sub sNameFile_RichTxBx_TextChanged(sender As Object, e As TextChangedEventArgs)
'If Not IsNothing(Map.refScriptWindowVM) Then Map.refScriptWindowVM.ChangeTextColor()
Try
If Not IsNothing(Map.refScriptWindowVM) Then Map.refScriptWindowVM.SyntaxHighlighting(sNameFile_RichTxBx)
Catch ex As Exception
End Try
'Try
' If Not IsNothing(Map.refScriptWindowVM) Then Map.refScriptWindowVM.SyntaxHighlighting(sNameFile_RichTxBx)
'Catch ex As Exception
'End Try
If Not IsNothing(Map.refScriptWindowVM) AndAlso Map.refScriptWindowVM.textChangedTimer Is Nothing Then
Map.refScriptWindowVM.textChangedTimer = New DispatcherTimer()
Map.refScriptWindowVM.textChangedTimer.Interval = TimeSpan.FromMilliseconds(500)
AddHandler Map.refScriptWindowVM.textChangedTimer.Tick, AddressOf OnTextChangedTimerTick
End If
If Not IsNothing(Map.refScriptWindowVM) Then
Map.refScriptWindowVM.textChangedTimer.Stop()
Map.refScriptWindowVM.textChangedTimer.Start()
End If
End Sub
Private Sub sNameFile_RichTxBx_SelectionChanged(sender As Object, e As RoutedEventArgs)
@@ -58,6 +69,12 @@
sNameFile_RichTxBx.ScrollToVerticalOffset(sNameFile_RichTxBx.VerticalOffset - linesToScroll)
End Sub
Private Sub OnTextChangedTimerTick(sender As Object, e As EventArgs)
Map.refScriptWindowVM.textChangedTimer.Stop()
If Not IsNothing(Map.refScriptWindowVM) Then Map.refScriptWindowVM.SyntaxHighlighting(sNameFile_RichTxBx)
Map.refScriptWindowVM.ProcessTextChanges()
End Sub
#End Region ' Events
End Class