Delegate Sub SetTextCallback([type] As String, [uid] As String, [connectedUid] As String, [position] As String, [hardwareVersion] As String, [firmwareVersion] As String, [deviceIdentifier] As String, [enumerationType] As String)
Private Sub SetText(ByVal [type] As String, ByVal [uid] As String, ByVal [connectedUid] As String, ByVal [position] As String, ByVal [hardwareVersion] As String, ByVal [firmwareVersion] As String, ByVal [deviceIdentifier] As String, ByVal [enumerationType] As String)
' InvokeRequired required compares the thread ID of the
' calling thread to the thread ID of the creating thread.
' If these threads are different, it returns true.
If Me.ListBox1.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[type], [uid], [connectedUid], [position], [hardwareVersion], [firmwareVersion], [deviceIdentifier], [enumerationType]})
Else
Me.ListBox1.Items.Add([type] & " " & [uid] & " " & [position] & " " & [hardwareVersion] & " " & [firmwareVersion] & " " & [deviceIdentifier] & " " & [enumerationType])
End If
End Sub
'im EnumerateCB
Dim hwv As String = hardwareVersion(0) & "." & hardwareVersion(1) & "." & hardwareVersion(2)
Dim fwv As String = firmwareVersion(0) & "." & firmwareVersion(1) & "." & firmwareVersion(2)
SetText("BrickMaster", uid, connectedUid, position, hwv, fwv, deviceIdentifier, enumerationType)