jj: Revert ChoiceList Method, Add WMCC Start Check, Only use a single instance of ClassPMWindream in Application

This commit is contained in:
Jonathan Jenne
2018-10-05 11:15:30 +02:00
parent 819c340745
commit 9ed2d35d17
9 changed files with 93 additions and 70 deletions

View File

@@ -62,33 +62,33 @@ Public Class ClassPMWindream
End Function
Public Function GetValuesfromAuswahlliste(ByVal listname As String)
Try
Dim oAttribute = Me.oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, listname)
Dim vType = oAttribute.getVariableValue("vItems")
Return vType
'Dim oChoiceList = oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityChoiceList, listname)
'If Err.Number = 0 And TypeName(oChoiceList) <> "Nothing" Then
' Dim Values = oChoiceList
' Values = oChoiceList.GetVariableValue("vItems")
' Dim anz As Integer = 0
'Dim oAttribute = Me.oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, listname)
'Dim vType = oAttribute.getVariableValue("vItems")
'Return vType
Dim oChoiceList = oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityChoiceList, listname)
If Err.Number = 0 And TypeName(oChoiceList) <> "Nothing" Then
Dim Values = oChoiceList
Values = oChoiceList.GetVariableValue("vItems")
Dim anz As Integer = 0
' For Each CLItem In Values
' If oChoiceList.aName IsNot Nothing Then
' anz += 1
' End If
' Next
' Dim strListe(anz - 1)
' Dim zahl As Integer = 0
' For Each CLItem In Values
' If oChoiceList.aName IsNot Nothing Then
' strListe(zahl) = CLItem
' zahl += 1
' End If
' Next
' Return strListe
'Else
' MsgBox("Auswahlliste: " & listname & " nicht gefunden!", MsgBoxStyle.Critical, "Fehler:")
' Return Nothing
'End If
For Each CLItem In Values
If oChoiceList.aName IsNot Nothing Then
anz += 1
End If
Next
Dim strListe(anz - 1)
Dim zahl As Integer = 0
For Each CLItem In Values
If oChoiceList.aName IsNot Nothing Then
strListe(zahl) = CLItem
zahl += 1
End If
Next
Return strListe
Else
MsgBox("Auswahlliste: " & listname & " nicht gefunden!", MsgBoxStyle.Critical, "Fehler:")
Return Nothing
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in GetValuesfromAuswahlliste:")