1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<FlagsAttribute()> _
Public Enum EAccessType As Integer
change = 1
insert = 2
delete = 4
move = 8
copy = 16
End Enum
' ermittelt die EmumMember Namen
' Bsp: ist Value 7 (change AND insert AND delete) ist das Ergebnis {"change", "insert", "delete"}
Public Function GetEnumItemNames( _
ByVal Value As EAccessType) As String()
Dim a As String
Dim b As String
Dim c As String()
a = Value.ToString
a = a.Replace(" ", "")
c = Split(a, ",")
a = ""
For Each b In c
If a <> "" Then a &= ","
a &= GetEnumValue(b)
Next
c = Split(a, ",")
Return c
End Function
' Ermittel den EnumMember Wert anhand dessen Namen
Private Function GetEnumValue(ByVal strName As String) As EAccessType
Enum.Parse(EAccessType.GetType(), strName) ' @_ntr_: danke ;-)
End Function
|