WIP: first pass of depending controls

This commit is contained in:
Jonathan Jenne
2020-02-10 17:09:14 +01:00
parent ee404100a4
commit acf61c9ca5
12 changed files with 275 additions and 211 deletions

View File

@@ -151,11 +151,35 @@ Public Class ClassPatterns
End If
Dim controlName As String = GetNextPattern(result, PATTERN_CTRL).Value
Dim control As Control = panel.Controls.Find(controlName, False).FirstOrDefault()
'Dim control As Control = panel.Controls.Find(controlName, False).FirstOrDefault()
Dim oFoundControl As Control = Nothing
If control IsNot Nothing Then
Dim value As String = control.Text
result = ReplacePattern(result, PATTERN_CTRL, value)
For Each oControl As Control In panel.Controls
If TypeOf oControl Is Label Then
Continue For
End If
Dim oMeta = DirectCast(oControl.Tag, ClassControls.ControlMeta)
Dim oIndex As String = oMeta.IndexName
If oIndex = controlName Then
oFoundControl = oControl
Exit For
End If
Next
If oFoundControl IsNot Nothing Then
Dim oValue As String = String.Empty
If TypeOf oFoundControl Is TextBox Then
oValue = DirectCast(oFoundControl, TextBox).Text
ElseIf TypeOf oFoundControl Is CheckBox Then
oValue = IIf(DirectCast(oFoundControl, CheckBox).Checked, 1, 0)
Else
oValue = ""
End If
result = ReplacePattern(result, PATTERN_CTRL, oValue)
End If
oTryCounter += 1