Refactor btnLink enabling logic by profile type
EnableBtnLink() now enables/disables btnLink based on the selected profile's type, applying specific logic for "db", "activedirectory", "xml", and "fulltext". The method is also called after regex and XML tree changes to keep the button state in sync with the UI.
This commit is contained in:
@@ -1396,9 +1396,30 @@ Public Class frmNIVerknuepfungen
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub EnableBtnLink()
|
Private Sub EnableBtnLink()
|
||||||
|
If Me._selectedProfil Is Nothing Then
|
||||||
|
btnLink.Enabled = False
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
Select Case Me._selectedProfil.Ni_Art
|
||||||
|
Case "db", "activedirectory"
|
||||||
btnLink.Enabled =
|
btnLink.Enabled =
|
||||||
lbxWMIndex.SelectedItems.Count > 0 And
|
lbxWMIndex.SelectedItems.Count > 0 And
|
||||||
(lbxQuelle1.SelectedItems.Count > 0 OrElse txtManIndexwert.Text <> "")
|
(lbxQuelle1.SelectedItems.Count > 0 OrElse txtManIndexwert.Text <> "")
|
||||||
|
|
||||||
|
Case "xml"
|
||||||
|
btnLink.Enabled =
|
||||||
|
lbxWMIndex.SelectedItems.Count > 0 And
|
||||||
|
(trvwxml.SelectedNode IsNot Nothing OrElse txtManIndexwert.Text <> "")
|
||||||
|
|
||||||
|
Case "fulltext"
|
||||||
|
btnLink.Enabled =
|
||||||
|
lbxWMIndex.SelectedItems.Count > 0 And
|
||||||
|
(txtregex.Text <> "" OrElse txtManIndexwert.Text <> "")
|
||||||
|
|
||||||
|
Case Else
|
||||||
|
btnLink.Enabled = False
|
||||||
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnLink_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLink.Click
|
Private Sub btnLink_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLink.Click
|
||||||
@@ -3463,6 +3484,7 @@ Public Class frmNIVerknuepfungen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
EnableBtnLink()
|
||||||
'Catch ex As Exception
|
'Catch ex As Exception
|
||||||
' MsgBox("Fehler bei Check Änderung Regex:" & vbNewLine & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
' MsgBox("Fehler bei Check Änderung Regex:" & vbNewLine & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
'End Try
|
'End Try
|
||||||
@@ -3611,8 +3633,7 @@ Public Class frmNIVerknuepfungen
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub trvwxml_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles trvwxml.AfterSelect
|
Private Sub trvwxml_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles trvwxml.AfterSelect
|
||||||
|
EnableBtnLink()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub tabctrlbottom_SelectedIndexChanged(sender As Object, e As EventArgs) Handles tabctrlbottom.SelectedIndexChanged
|
Private Sub tabctrlbottom_SelectedIndexChanged(sender As Object, e As EventArgs) Handles tabctrlbottom.SelectedIndexChanged
|
||||||
|
|||||||
Reference in New Issue
Block a user