我有一个字典结构如下:
Public Structure MyStruct
Dim X as Integer
Dim Y as Integer
Dim Z as Integer
Dim W as Integer
End Structure
Public Shared MyDic As New Dictionary(Of String, MyStruct)
我需要通过另一个类中的函数将一些数据插入到字典中。如何将MyDic
和MyStruct
链接到该类以将数据添加到字典中?
一般情况如下:
Public Class myFirstForm
Public Structure MyStruct
Dim X as Integer
Dim Y as Integer
Dim Z as Integer
Dim W as Integer
End Structure
Public Shared MyDic As New Dictionary(Of String, MyStruct)
End Class
Public Class myClass
Public Sub mySub()
Dim Struct as New MyStruct
'Some code
MyDic.Add("FirstElement",Struct)
End Sub
End Class
答案 0 :(得分:0)
我解决了这个问题:
GlobalConfigMiddleware.php