我正在尝试为我的一种标记语言创建一个元素对象。 我怎么也无法以任何方式与对象进行交互。我得到的错误就像无法访问cetern变量一样,如果我尝试创建该类的变量,程序不会将创建的变量视为与raw相同类。 我知道布局不正确但不确定如何使其工作。这是原始的所有结构然后同类。
Structure RUI_Elements
Public Class Text
Class location
Friend X As Int16
Public Y As Int16
Public Z As Int16
End Class
Public mode As String
Structure dimensions
Shared width As Int16
Shared height As Int16
End Structure
Structure region
Shared left As Int16
Shared right As Int16
Shared top As Int16
Shared bottom As Int16
End Structure
Structure configModes
Shared currentMode As Byte
Shared modes As Dictionary(Of String, Dictionary(Of String, String))
End Structure
Structure contentModes
Shared currentMode As Byte
Shared modes As Dictionary(Of String, String)
End Structure
End Class
End Structure
它说我需要用RUI_Element.text替换newtext如何newtext是RUI_Element.text对象
Structure createRUIELEMENTS
Shared Function createTEXT() As RUI_Elements.Text
Dim newtext As RUI_Elements.Text
newtext = New RUI_Elements.Text
newtext.mode = ""
newtext.location.X = 0
newtext.location.Y = 0
newtext.location.Z = 0
newtext.configModes.modes = New Dictionary(Of String, Dictionary(Of String, String))
newtext.configModes.currentMode = 0
newtext.contentModes.modes = New Dictionary(Of String, String)
newtext.contentModes.currentMode = 0
Return newtext
End Function
End Structure