我的项目经理要求我从我们的解决方案中删除所有“Option Infer On”指令(在他看来,为了没有未定义的类型)。
Dim enums = [Enum].GetValues(enumType) ' here I will use "As Array"
For Each item In enums ' <================== WHAT TYPE TO USE HERE?
Dim ienum As [Enum] = CType(item, [Enum])
Dim name As String
Dim caption As String
name = ienum.GetPropertyName
caption = ienum.GetStringValue
myDict.Add(caption, name)
Next item