-pulizia codice

This commit is contained in:
Demetrio Cassarino
2025-03-03 17:17:44 +01:00
parent f3bd024f29
commit 5f2c355121
2 changed files with 35 additions and 32 deletions
+32
View File
@@ -504,8 +504,40 @@ Public Class ScriptWindowVM
SyntaxHighlighting(Map.refScriptWindowV.sNameFile_RichTxBx)
End Sub
Public Sub ChangeTimer()
If Not IsNothing(Map.refScriptWindowVM) AndAlso textChangedTimer Is Nothing Then
textChangedTimer = New DispatcherTimer()
textChangedTimer.Interval = TimeSpan.FromMilliseconds(500)
AddHandler textChangedTimer.Tick, AddressOf OnTextChangedTimerTick
End If
textChangedTimer.Stop()
textChangedTimer.Start()
End Sub
Public Sub Tabulation(ByVal sRichTextBox As RichTextBox)
' Ottieni la posizione corrente del cursore
Dim caretPosition As TextPointer = sRichTextBox.CaretPosition
' Inserisci un carattere di tabulazione (3 spazi)
Dim tabString As String = " "
Dim run As New Run(tabString)
Dim textRange As New TextRange(caretPosition, caretPosition)
textRange.Text = tabString
' Aggiorna la posizione del cursore
sRichTextBox.CaretPosition = textRange.End
End Sub
#End Region ' Methods
#Region "EVENTS"
Private Sub OnTextChangedTimerTick(sender As Object, e As EventArgs)
textChangedTimer.Stop()
ProcessTextChanges()
End Sub
#End Region ' Events
#Region "COMMANDS"
#Region "ConfermCmd"